<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chapter 24 INFORMATION_SCHEMA Tables</title>
<link rel="stylesheet" href="mvl.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets + chunker.py v1.9.2" />
<link rel="start" href="index.html" title="{book-title}" />
<link rel="up" href="" title="" />
<link rel="prev" href="stored-programs-views.html" title="Chapter 23 Stored Programs and Views" />
<link rel="next" href="performance-schema.html" title="Chapter 25 MySQL Performance Schema" />
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Chapter 24 INFORMATION_SCHEMA Tables</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="stored-programs-views.html">Prev</a> </td>
<th width="60%" align="center"></th>
<td width="20%" align="right"> <a accesskey="n" href="performance-schema.html">Next</a></td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="information-schema"></a>Chapter 24 INFORMATION_SCHEMA Tables</h1>

</div>

</div>

</div>
<div class="toc">
<p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="information-schema.html#character-sets-table">24.1 The INFORMATION_SCHEMA CHARACTER_SETS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#collations-table">24.2 The INFORMATION_SCHEMA COLLATIONS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#collation-character-set-applicability-table">24.3 The INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY Table</a></span></dt><dt><span class="section"><a href="information-schema.html#columns-table">24.4 The INFORMATION_SCHEMA COLUMNS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#column-privileges-table">24.5 The INFORMATION_SCHEMA COLUMN_PRIVILEGES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#engines-table">24.6 The INFORMATION_SCHEMA ENGINES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#events-table">24.7 The INFORMATION_SCHEMA EVENTS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#files-table">24.8 The INFORMATION_SCHEMA FILES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#status-table">24.9 The INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#variables-table">24.10 The INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#key-column-usage-table">24.11 The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#ndb-transid-mysql-connection-map-table">24.12 The INFORMATION_SCHEMA ndb_transid_mysql_connection_map Table</a></span></dt><dt><span class="section"><a href="information-schema.html#optimizer-trace-table">24.13 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#parameters-table">24.14 The INFORMATION_SCHEMA PARAMETERS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#partitions-table">24.15 The INFORMATION_SCHEMA PARTITIONS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#plugins-table">24.16 The INFORMATION_SCHEMA PLUGINS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#processlist-table">24.17 The INFORMATION_SCHEMA PROCESSLIST Table</a></span></dt><dt><span class="section"><a href="information-schema.html#profiling-table">24.18 The INFORMATION_SCHEMA PROFILING Table</a></span></dt><dt><span class="section"><a href="information-schema.html#referential-constraints-table">24.19 The INFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#routines-table">24.20 The INFORMATION_SCHEMA ROUTINES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#schemata-table">24.21 The INFORMATION_SCHEMA SCHEMATA Table</a></span></dt><dt><span class="section"><a href="information-schema.html#schema-privileges-table">24.22 The INFORMATION_SCHEMA SCHEMA_PRIVILEGES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#statistics-table">24.23 The INFORMATION_SCHEMA STATISTICS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#tables-table">24.24 The INFORMATION_SCHEMA TABLES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#tablespaces-table">24.25 The INFORMATION_SCHEMA TABLESPACES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#table-constraints-table">24.26 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#table-privileges-table">24.27 The INFORMATION_SCHEMA TABLE_PRIVILEGES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#triggers-table">24.28 The INFORMATION_SCHEMA TRIGGERS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#user-privileges-table">24.29 The INFORMATION_SCHEMA USER_PRIVILEGES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#views-table">24.30 The INFORMATION_SCHEMA VIEWS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-i_s-tables">24.31 InnoDB INFORMATION_SCHEMA Tables</a></span></dt><dd><dl><dt><span class="section"><a href="information-schema.html#innodb-buffer-page-table">24.31.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-buffer-page-lru-table">24.31.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-buffer-pool-stats-table">24.31.3 The INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-cmp-table">24.31.4 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-cmpmem-table">24.31.5 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-cmp-per-index-table">24.31.6 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and
INNODB_CMP_PER_INDEX_RESET Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-being-deleted-table">24.31.7 The INFORMATION_SCHEMA INNODB_FT_BEING_DELETED Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-config-table">24.31.8 The INFORMATION_SCHEMA INNODB_FT_CONFIG Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-default-stopword-table">24.31.9 The INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-deleted-table">24.31.10 The INFORMATION_SCHEMA INNODB_FT_DELETED Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-index-cache-table">24.31.11 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-index-table-table">24.31.12 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-locks-table">24.31.13 The INFORMATION_SCHEMA INNODB_LOCKS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-lock-waits-table">24.31.14 The INFORMATION_SCHEMA INNODB_LOCK_WAITS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-metrics-table">24.31.15 The INFORMATION_SCHEMA INNODB_METRICS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-columns-table">24.31.16 The INFORMATION_SCHEMA INNODB_SYS_COLUMNS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-datafiles-table">24.31.17 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-fields-table">24.31.18 The INFORMATION_SCHEMA INNODB_SYS_FIELDS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-foreign-table">24.31.19 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-foreign-cols-table">24.31.20 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN_COLS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-indexes-table">24.31.21 The INFORMATION_SCHEMA INNODB_SYS_INDEXES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-tables-table">24.31.22 The INFORMATION_SCHEMA INNODB_SYS_TABLES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-tablespaces-table">24.31.23 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-tablestats-table">24.31.24 The INFORMATION_SCHEMA INNODB_SYS_TABLESTATS View</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-virtual-table">24.31.25 The INFORMATION_SCHEMA INNODB_SYS_VIRTUAL Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-temp-table-info-table">24.31.26 The INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-trx-table">24.31.27 The INFORMATION_SCHEMA INNODB_TRX Table</a></span></dt></dl></dd><dt><span class="section"><a href="information-schema.html#thread-pool-i_s-tables">24.32 Thread Pool INFORMATION_SCHEMA Tables</a></span></dt><dd><dl><dt><span class="section"><a href="information-schema.html#tp-thread-group-state-table">24.32.1 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#tp-thread-group-stats-table">24.32.2 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#tp-thread-state-table">24.32.3 The INFORMATION_SCHEMA TP_THREAD_STATE Table</a></span></dt></dl></dd><dt><span class="section"><a href="information-schema.html#connection-control-i_s-tables">24.33 Connection-Control INFORMATION_SCHEMA Tables</a></span></dt><dd><dl><dt><span class="section"><a href="information-schema.html#connection-control-failed-login-attempts-table">24.33.1 The INFORMATION_SCHEMA CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS Table</a></span></dt></dl></dd><dt><span class="section"><a href="information-schema.html#extended-show">24.34 Extensions to SHOW Statements</a></span></dt></dl>
</div>
<a class="indexterm" name="idm140710594013424"></a><a class="indexterm" name="idm140710594011968"></a><a class="indexterm" name="idm140710594010896"></a><a class="indexterm" name="idm140710594009824"></a><a class="indexterm" name="idm140710594008752"></a><p>
    <code class="literal">INFORMATION_SCHEMA</code> provides access to database
    <span class="firstterm">metadata</span>, information about
    the MySQL server such as the name of a database or table, the data
    type of a column, or access privileges. Other terms that are
    sometimes used for this information are
    <span class="firstterm">data dictionary</span> and
    <span class="firstterm">system catalog</span>.
</p>
<h2><a name="idm140710594003792"></a>INFORMATION_SCHEMA Usage Notes</h2>
<p>
    <code class="literal">INFORMATION_SCHEMA</code> is a database within each
    MySQL instance, the place that stores information about all the
    other databases that the MySQL server maintains. The
    <code class="literal">INFORMATION_SCHEMA</code> database contains several
    read-only tables. They are actually views, not base tables, so there
    are no files associated with them, and you cannot set triggers on
    them. Also, there is no database directory with that name.
  </p><p>
    Although you can select <code class="literal">INFORMATION_SCHEMA</code> as the
    default database with a <a class="link" href="sql-syntax.html#use" title="13.8.4 USE Syntax"><code class="literal">USE</code></a>
    statement, you can only read the contents of tables, not perform
    <a class="link" href="sql-syntax.html#insert" title="13.2.5 INSERT Syntax"><code class="literal">INSERT</code></a>,
    <a class="link" href="sql-syntax.html#update" title="13.2.11 UPDATE Syntax"><code class="literal">UPDATE</code></a>, or
    <a class="link" href="sql-syntax.html#delete" title="13.2.2 DELETE Syntax"><code class="literal">DELETE</code></a> operations on them.
</p>
<h2><a name="idm140710593994784"></a>Example</h2>
<p>
    Here is an example of a statement that retrieves information from
    <code class="literal">INFORMATION_SCHEMA</code>:
  </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT table_name, table_type, engine</code></strong>
       <strong class="userinput"><code>FROM information_schema.tables</code></strong>
       <strong class="userinput"><code>WHERE table_schema = 'db5'</code></strong>
       <strong class="userinput"><code>ORDER BY table_name;</code></strong>
+------------+------------+--------+
| table_name | table_type | engine |
+------------+------------+--------+
| fk         | BASE TABLE | InnoDB |
| fk2        | BASE TABLE | InnoDB |
| goto       | BASE TABLE | MyISAM |
| into       | BASE TABLE | MyISAM |
| k          | BASE TABLE | MyISAM |
| kurs       | BASE TABLE | MyISAM |
| loop       | BASE TABLE | MyISAM |
| pk         | BASE TABLE | InnoDB |
| t          | BASE TABLE | MyISAM |
| t2         | BASE TABLE | MyISAM |
| t3         | BASE TABLE | MyISAM |
| t7         | BASE TABLE | MyISAM |
| tables     | BASE TABLE | MyISAM |
| v          | VIEW       | NULL   |
| v2         | VIEW       | NULL   |
| v3         | VIEW       | NULL   |
| v56        | VIEW       | NULL   |
+------------+------------+--------+
17 rows in set (0.01 sec)
</pre><p>
    Explanation: The statement requests a list of all the tables in
    database <code class="literal">db5</code>, showing just three pieces of
    information: the name of the table, its type, and its storage
    engine.
</p>
<h2><a name="idm140710593987040"></a>Character Set Considerations</h2>
<p>
    The definition for character columns (for example,
    <code class="literal">TABLES.TABLE_NAME</code>) is generally
    <code class="literal">VARCHAR(<em class="replaceable"><code>N</code></em>) CHARACTER SET
    utf8</code> where <em class="replaceable"><code>N</code></em> is at least 64.
    MySQL uses the default collation for this character set
    (<code class="literal">utf8_general_ci</code>) for all searches, sorts,
    comparisons, and other string operations on such columns.
  </p><p>
    Because some MySQL objects are represented as files, searches in
    <code class="literal">INFORMATION_SCHEMA</code> string columns can be affected
    by file system case sensitivity. For more information, see
    <a class="xref" href="charset.html#charset-collation-information-schema" title="10.8.7 Using Collation in INFORMATION_SCHEMA Searches">Section 10.8.7, “Using Collation in INFORMATION_SCHEMA Searches”</a>.
</p>
<h2><a name="idm140710593980672"></a>INFORMATION_SCHEMA as Alternative to SHOW Statements</h2>
<p>
    The <code class="literal">SELECT ... FROM INFORMATION_SCHEMA</code> statement
    is intended as a more consistent way to provide access to the
    information provided by the various
    <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements that MySQL supports
    (<a class="link" href="sql-syntax.html#show-databases" title="13.7.5.14 SHOW DATABASES Syntax"><code class="literal">SHOW DATABASES</code></a>,
    <a class="link" href="sql-syntax.html#show-tables" title="13.7.5.37 SHOW TABLES Syntax"><code class="literal">SHOW TABLES</code></a>, and so forth). Using
    <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> has these advantages, compared
    to <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        It conforms to Codd's rules, because all access is done on
        tables.
      </p></li><li class="listitem"><p>
        You can use the familiar syntax of the
        <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> statement, and only need
        to learn some table and column names.
      </p></li><li class="listitem"><p>
        The implementor need not worry about adding keywords.
      </p></li><li class="listitem"><p>
        You can filter, sort, concatenate, and transform the results
        from <code class="literal">INFORMATION_SCHEMA</code> queries into whatever
        format your application needs, such as a data structure or a
        text representation to parse.
      </p></li><li class="listitem"><p>
        This technique is more interoperable with other database
        systems. For example, Oracle Database users are familiar with
        querying tables in the Oracle data dictionary.
</p></li></ul>
</div>
<p>
    Because <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> is familiar and widely
    used, the <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements remain as
    an alternative. In fact, along with the implementation of
    <code class="literal">INFORMATION_SCHEMA</code>, there are enhancements to
    <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> as described in
    <a class="xref" href="information-schema.html#extended-show" title="24.34 Extensions to SHOW Statements">Section 24.34, “Extensions to SHOW Statements”</a>.
</p>
<h2><a name="idm140710593959936"></a>Privileges</h2>
<p>
    Each MySQL user has the right to access these tables, but can see
    only the rows in the tables that correspond to objects for which the
    user has the proper access privileges. In some cases (for example,
    the <code class="literal">ROUTINE_DEFINITION</code> column in the
    <a class="link" href="information-schema.html#routines-table" title="24.20 The INFORMATION_SCHEMA ROUTINES Table"><code class="literal">INFORMATION_SCHEMA.ROUTINES</code></a> table),
    users who have insufficient privileges see <code class="literal">NULL</code>.
    These restrictions do not apply for
    <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables; you can see them with
    only the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a> privilege.
  </p><p>
    The same privileges apply to selecting information from
    <code class="literal">INFORMATION_SCHEMA</code> and viewing the same
    information through <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements.
    In either case, you must have some privilege on an object to see
    information about it.
</p>
<h2><a name="idm140710593950816"></a>Performance Considerations</h2>
<p>
    <code class="literal">INFORMATION_SCHEMA</code> queries that search for
    information from more than one database might take a long time and
    impact performance. To check the efficiency of a query, you can use
    <a class="link" href="sql-syntax.html#explain" title="13.8.2 EXPLAIN Syntax"><code class="literal">EXPLAIN</code></a>. For information about using
    <a class="link" href="sql-syntax.html#explain" title="13.8.2 EXPLAIN Syntax"><code class="literal">EXPLAIN</code></a> output to tune
    <code class="literal">INFORMATION_SCHEMA</code> queries, see
    <a class="xref" href="optimization.html#information-schema-optimization" title="8.2.3 Optimizing INFORMATION_SCHEMA Queries">Section 8.2.3, “Optimizing INFORMATION_SCHEMA Queries”</a>.
</p>
<h2><a name="idm140710593944880"></a>Standards Considerations</h2>
<p>
    The implementation for the <code class="literal">INFORMATION_SCHEMA</code>
    table structures in MySQL follows the ANSI/ISO SQL:2003 standard
    Part 11 <em class="citetitle">Schemata</em>. Our intent is approximate
    compliance with SQL:2003 core feature F021 <em class="citetitle">Basic
    information schema</em>.
  </p><p>
    Users of SQL Server 2000 (which also follows the standard) may
    notice a strong similarity. However, MySQL has omitted many columns
    that are not relevant for our implementation, and added columns that
    are MySQL-specific. One such column is the <code class="literal">ENGINE</code>
    column in the <a class="link" href="information-schema.html#tables-table" title="24.24 The INFORMATION_SCHEMA TABLES Table"><code class="literal">INFORMATION_SCHEMA.TABLES</code></a>
    table.
  </p><p>
    Although other DBMSs use a variety of names, like
    <code class="literal">syscat</code> or <code class="literal">system</code>, the standard
    name is <code class="literal">INFORMATION_SCHEMA</code>.
  </p><p>
    To avoid using any name that is reserved in the standard or in DB2,
    SQL Server, or Oracle, we changed the names of some columns marked
    <span class="quote">“<span class="quote">MySQL extension</span>”</span>. (For example, we changed
    <code class="literal">COLLATION</code> to <code class="literal">TABLE_COLLATION</code>
    in the <a class="link" href="information-schema.html#tables-table" title="24.24 The INFORMATION_SCHEMA TABLES Table"><code class="literal">TABLES</code></a> table.) See the list of
    reserved words near the end of this article:
    <a class="ulink" href="https://web.archive.org/web/20070428032454/http://www.dbazine.com/db2/db2-disarticles/gulutzan5" target="_top">https://web.archive.org/web/20070428032454/http://www.dbazine.com/db2/db2-disarticles/gulutzan5</a>.
</p>
<h2><a name="idm140710593931424"></a>Conventions in the INFORMATION_SCHEMA Reference Sections</h2>
<p>
    The following sections describe each of the tables and columns in
    <code class="literal">INFORMATION_SCHEMA</code>. For each column, there are
    three pieces of information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        <span class="quote">“<span class="quote"><code class="literal">INFORMATION_SCHEMA</code> Name</span>”</span>
        indicates the name for the column in the
        <code class="literal">INFORMATION_SCHEMA</code> table. This corresponds to
        the standard SQL name unless the <span class="quote">“<span class="quote">Remarks</span>”</span> field
        says <span class="quote">“<span class="quote">MySQL extension.</span>”</span>
      </p></li><li class="listitem"><p>
        <span class="quote">“<span class="quote"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</span>”</span>
        indicates the equivalent field name in the closest
        <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statement, if there is one.
      </p></li><li class="listitem"><p>
        <span class="quote">“<span class="quote">Remarks</span>”</span> provides additional information where
        applicable. If this field is <code class="literal">NULL</code>, it means
        that the value of the column is always <code class="literal">NULL</code>.
        If this field says <span class="quote">“<span class="quote">MySQL extension,</span>”</span> the column is
        a MySQL extension to standard SQL.

        
</p></li></ul>
</div>
<p>
    Many sections indicate what <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a>
    statement is equivalent to a <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a>
    that retrieves information from
    <code class="literal">INFORMATION_SCHEMA</code>. For
    <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements that display
    information for the default database if you omit a <code class="literal">FROM
    <em class="replaceable"><code>db_name</code></em></code> clause, you can often
    select information for the default database by adding an
    <code class="literal">AND TABLE_SCHEMA = SCHEMA()</code> condition to the
    <code class="literal">WHERE</code> clause of a query that retrieves
    information from an <code class="literal">INFORMATION_SCHEMA</code> table.
</p>
<h2><a name="idm140710593909328"></a>Related Information</h2>
<p>
    These sections discuss additional
    <code class="literal">INFORMATION_SCHEMA</code>-related topics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        information about <code class="literal">INFORMATION_SCHEMA</code> tables
        specific to the <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> storage
        engine: <a class="xref" href="information-schema.html#innodb-i_s-tables" title="24.31 InnoDB INFORMATION_SCHEMA Tables">Section 24.31, “InnoDB INFORMATION_SCHEMA Tables”</a>
      </p></li><li class="listitem"><p>
        information about <code class="literal">INFORMATION_SCHEMA</code> tables
        specific to the thread pool plugin:
        <a class="xref" href="information-schema.html#thread-pool-i_s-tables" title="24.32 Thread Pool INFORMATION_SCHEMA Tables">Section 24.32, “Thread Pool INFORMATION_SCHEMA Tables”</a>
      </p></li><li class="listitem"><p>
        Answers to questions that are often asked concerning the
        <code class="literal">INFORMATION_SCHEMA</code> database:
        <a class="xref" href="faqs.html#faqs-information-schema" title="A.7 MySQL 5.7 FAQ: INFORMATION_SCHEMA">Section A.7, “MySQL 5.7 FAQ: INFORMATION_SCHEMA”</a>
      </p></li><li class="listitem"><p>
        <code class="literal">INFORMATION_SCHEMA</code> queries and the optimizer:
        <a class="xref" href="optimization.html#information-schema-optimization" title="8.2.3 Optimizing INFORMATION_SCHEMA Queries">Section 8.2.3, “Optimizing INFORMATION_SCHEMA Queries”</a>
      </p></li><li class="listitem"><p>
        The effect of collation on <code class="literal">INFORMATION_SCHEMA</code>
        comparisons:
        <a class="xref" href="charset.html#charset-collation-information-schema" title="10.8.7 Using Collation in INFORMATION_SCHEMA Searches">Section 10.8.7, “Using Collation in INFORMATION_SCHEMA Searches”</a>
</p></li></ul>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="character-sets-table"></a>24.1 The INFORMATION_SCHEMA CHARACTER_SETS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593893472"></a><p>
      The <a class="link" href="information-schema.html#character-sets-table" title="24.1 The INFORMATION_SCHEMA CHARACTER_SETS Table"><code class="literal">CHARACTER_SETS</code></a> table provides
      information about available character sets.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA CHARACTER_SETS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_NAME</code></td>
          <td><code class="literal">Charset</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DEFAULT_COLLATE_NAME</code></td>
          <td><code class="literal">Default collation</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DESCRIPTION</code></td>
          <td><code class="literal">Description</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAXLEN</code></td>
          <td><code class="literal">Maxlen</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      The following statements are equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS
  [WHERE CHARACTER_SET_NAME LIKE '<em class="replaceable"><code>wild</code></em>']

SHOW CHARACTER SET
  [LIKE '<em class="replaceable"><code>wild</code></em>']
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="collations-table"></a>24.2 The INFORMATION_SCHEMA COLLATIONS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593861600"></a><p>
      The <a class="link" href="information-schema.html#collations-table" title="24.2 The INFORMATION_SCHEMA COLLATIONS Table"><code class="literal">COLLATIONS</code></a> table provides
      information about collations for each character set.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA COLLATIONS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">COLLATION_NAME</code></td>
          <td><code class="literal">Collation</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_NAME</code></td>
          <td><code class="literal">Charset</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ID</code></td>
          <td><code class="literal">Id</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_DEFAULT</code></td>
          <td><code class="literal">Default</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_COMPILED</code></td>
          <td><code class="literal">Compiled</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SORTLEN</code></td>
          <td><code class="literal">Sortlen</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">COLLATION_NAME</code> is the collation name.
        </p></li><li class="listitem"><p>
          <code class="literal">CHARACTER_SET_NAME</code> is the name of the
          character set with which the collation is associated.
        </p></li><li class="listitem"><p>
          <code class="literal">ID</code> is the collation ID.
        </p></li><li class="listitem"><p>
          <code class="literal">IS_DEFAULT</code> indicates whether the collation
          is the default for its character set.
        </p></li><li class="listitem"><p>
          <code class="literal">IS_COMPILED</code> indicates whether the character
          set is compiled into the server.
        </p></li><li class="listitem"><p>
          <code class="literal">SORTLEN</code> is related to the amount of memory
          required to sort strings expressed in the character set.
</p></li></ul>
</div>
<p>
      Collation information is also available from the
      <a class="link" href="sql-syntax.html#show-collation" title="13.7.5.4 SHOW COLLATION Syntax"><code class="literal">SHOW COLLATION</code></a> statement. The
      following statements are equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS
  [WHERE COLLATION_NAME LIKE '<em class="replaceable"><code>wild</code></em>']

SHOW COLLATION
  [LIKE '<em class="replaceable"><code>wild</code></em>']
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="collation-character-set-applicability-table"></a>24.3 The INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593810224"></a><p>
      The
      <a class="link" href="information-schema.html#collation-character-set-applicability-table" title="24.3 The INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY Table"><code class="literal">COLLATION_CHARACTER_SET_APPLICABILITY</code></a>
      table indicates what character set is applicable for what
      collation. The columns are equivalent to the first two display
      fields that we get from <a class="link" href="sql-syntax.html#show-collation" title="13.7.5.4 SHOW COLLATION Syntax"><code class="literal">SHOW
      COLLATION</code></a>.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA COLLATION_CHARACTER_SET_APPLICABILITY table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">COLLATION_NAME</code></td>
          <td><code class="literal">Collation</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_NAME</code></td>
          <td><code class="literal">Charset</code></td>
          <td></td>
</tr></tbody></table>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="columns-table"></a>24.4 The INFORMATION_SCHEMA COLUMNS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593787232"></a><p>
      The <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table provides
      information about columns in tables.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA COLUMNS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_NAME</code></td>
          <td><code class="literal">Field</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ORDINAL_POSITION</code></td>
          <td></td>
          <td>see notes</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_DEFAULT</code></td>
          <td><code class="literal">Default</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_NULLABLE</code></td>
          <td><code class="literal">Null</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_TYPE</code></td>
          <td><code class="literal">Type</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_MAXIMUM_LENGTH</code></td>
          <td><code class="literal">Type</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_OCTET_LENGTH</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMERIC_PRECISION</code></td>
          <td><code class="literal">Type</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMERIC_SCALE</code></td>
          <td><code class="literal">Type</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DATETIME_PRECISION</code></td>
          <td><code class="literal">Type</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION_NAME</code></td>
          <td><code class="literal">Collation</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_TYPE</code></td>
          <td><code class="literal">Type</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_KEY</code></td>
          <td><code class="literal">Key</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EXTRA</code></td>
          <td><code class="literal">Extra</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PRIVILEGES</code></td>
          <td><code class="literal">Privileges</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_COMMENT</code></td>
          <td><code class="literal">Comment</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">GENERATION_EXPRESSION</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p><a class="indexterm" name="idm140710593693120"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          In <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a>, the
          <code class="literal">Type</code> display includes values from several
          different <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> columns.
        </p></li><li class="listitem"><p>
          <code class="literal">ORDINAL_POSITION</code> is necessary because you
          might want to say <code class="literal">ORDER BY
          ORDINAL_POSITION</code>. Unlike
          <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a>,
          <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> does not have automatic
          ordering.
        </p></li><li class="listitem"><p>
          <code class="literal">CHARACTER_OCTET_LENGTH</code> should be the same
          as <code class="literal">CHARACTER_MAXIMUM_LENGTH</code>, except for
          multibyte character sets.
        </p></li><li class="listitem"><p>
          <code class="literal">CHARACTER_SET_NAME</code> can be derived from
          <code class="literal">Collation</code>. For example, if you say
          <code class="literal">SHOW FULL COLUMNS FROM t</code>, and you see in
          the <code class="literal">Collation</code> column a value of
          <code class="literal">latin1_swedish_ci</code>, the character set is
          what is before the first underscore:
          <code class="literal">latin1</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">GENERATION_EXPRESSION</code> is nonempty for
          generated columns and displays the expression used to compute
          column values. For information about generated columns, see
          <a class="xref" href="sql-syntax.html#create-table-generated-columns" title="13.1.18.8 CREATE TABLE and Generated Columns">Section 13.1.18.8, “CREATE TABLE and Generated Columns”</a>.
        </p></li><li class="listitem"><p>
          The <code class="literal">EXTRA</code> column contains <code class="literal">VIRTUAL
          GENERATED</code> or <code class="literal">VIRTUAL STORED</code> for
          generated columns.
</p></li></ul>
</div>
<p>
      The following statements are nearly equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE, COLUMN_DEFAULT
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE table_name = '<em class="replaceable"><code>tbl_name</code></em>'
  [AND table_schema = '<em class="replaceable"><code>db_name</code></em>']
  [AND column_name LIKE '<em class="replaceable"><code>wild</code></em>']

SHOW COLUMNS
  FROM <em class="replaceable"><code>tbl_name</code></em>
  [FROM <em class="replaceable"><code>db_name</code></em>]
  [LIKE '<em class="replaceable"><code>wild</code></em>']
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="column-privileges-table"></a>24.5 The INFORMATION_SCHEMA COLUMN_PRIVILEGES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593664032"></a><p>
      The <a class="link" href="information-schema.html#column-privileges-table" title="24.5 The INFORMATION_SCHEMA COLUMN_PRIVILEGES Table"><code class="literal">COLUMN_PRIVILEGES</code></a> table provides
      information about column privileges. This information comes from
      the <code class="literal">mysql.columns_priv</code> grant table.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA COLUMN_PRIVILEGES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">GRANTEE</code></td>
          <td></td>
          <td><code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
            value</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">PRIVILEGE_TYPE</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_GRANTABLE</code></td>
          <td></td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          In the output from
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW FULL
          COLUMNS</code></a>, the privileges are all in one field and in
          lowercase, for example,
          <code class="literal">select,insert,update,references</code>. In
          <a class="link" href="information-schema.html#column-privileges-table" title="24.5 The INFORMATION_SCHEMA COLUMN_PRIVILEGES Table"><code class="literal">COLUMN_PRIVILEGES</code></a>, there is one
          privilege per row, in uppercase.
        </p></li><li class="listitem"><p>
          <code class="literal">PRIVILEGE_TYPE</code> can contain one (and only
          one) of these values: <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a>,
          <a class="link" href="security.html#priv_insert"><code class="literal">INSERT</code></a>,
          <a class="link" href="security.html#priv_update"><code class="literal">UPDATE</code></a>,
          <a class="link" href="security.html#priv_references"><code class="literal">REFERENCES</code></a>.
        </p></li><li class="listitem"><p>
          If the user has <a class="link" href="security.html#priv_grant-option"><code class="literal">GRANT OPTION</code></a>
          privilege, <code class="literal">IS_GRANTABLE</code> should be
          <code class="literal">YES</code>. Otherwise,
          <code class="literal">IS_GRANTABLE</code> should be
          <code class="literal">NO</code>. The output does not list
          <a class="link" href="security.html#priv_grant-option"><code class="literal">GRANT OPTION</code></a> as a separate
          privilege.
</p></li></ul>
</div>
<p>
      The following statements are <span class="emphasis"><em>not</em></span> equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT ... FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES

SHOW GRANTS ...
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="engines-table"></a>24.6 The INFORMATION_SCHEMA ENGINES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593603776"></a><p>
      The <a class="link" href="information-schema.html#engines-table" title="24.6 The INFORMATION_SCHEMA ENGINES Table"><code class="literal">ENGINES</code></a> table provides
      information about storage engines.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA ENGINES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">ENGINE</code></td>
          <td><code class="literal">Engine</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SUPPORT</code></td>
          <td><code class="literal">Support</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMMENT</code></td>
          <td><code class="literal">Comment</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRANSACTIONS</code></td>
          <td><code class="literal">Transactions</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">XA</code></td>
          <td><code class="literal">XA</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SAVEPOINTS</code></td>
          <td><code class="literal">Savepoints</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <a class="link" href="information-schema.html#engines-table" title="24.6 The INFORMATION_SCHEMA ENGINES Table"><code class="literal">ENGINES</code></a> table is a
          nonstandard table. Its contents correspond to the columns of
          the <code class="literal">SHOW ENGINES</code> statement. For
          descriptions of its columns, see
          <a class="xref" href="sql-syntax.html#show-engines" title="13.7.5.16 SHOW ENGINES Syntax">Section 13.7.5.16, “SHOW ENGINES Syntax”</a>.
</p></li></ul>
</div>
<p>
      See also <a class="xref" href="sql-syntax.html#show-engines" title="13.7.5.16 SHOW ENGINES Syntax">Section 13.7.5.16, “SHOW ENGINES Syntax”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="events-table"></a>24.7 The INFORMATION_SCHEMA EVENTS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593559568"></a><p>
      The <a class="link" href="information-schema.html#events-table" title="24.7 The INFORMATION_SCHEMA EVENTS Table"><code class="literal">EVENTS</code></a> table provides information
      about scheduled events, which are discussed in
      <a class="xref" href="stored-programs-views.html#event-scheduler" title="23.4 Using the Event Scheduler">Section 23.4, “Using the Event Scheduler”</a>. The <code class="literal">SHOW
      Name</code> values correspond to column names of the
      <a class="link" href="sql-syntax.html#show-events" title="13.7.5.18 SHOW EVENTS Syntax"><code class="literal">SHOW EVENTS</code></a> statement.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA EVENTS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">EVENT_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code>, MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_SCHEMA</code></td>
          <td><code class="literal">Db</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_NAME</code></td>
          <td><code class="literal">Name</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DEFINER</code></td>
          <td><code class="literal">Definer</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TIME_ZONE</code></td>
          <td><code class="literal">Time zone</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_BODY</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_DEFINITION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_TYPE</code></td>
          <td><code class="literal">Type</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EXECUTE_AT</code></td>
          <td><code class="literal">Execute at</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INTERVAL_VALUE</code></td>
          <td><code class="literal">Interval value</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INTERVAL_FIELD</code></td>
          <td><code class="literal">Interval field</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SQL_MODE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">STARTS</code></td>
          <td><code class="literal">Starts</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ENDS</code></td>
          <td><code class="literal">Ends</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">STATUS</code></td>
          <td><code class="literal">Status</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ON_COMPLETION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATED</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LAST_ALTERED</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LAST_EXECUTED</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_COMMENT</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ORIGINATOR</code></td>
          <td><code class="literal">Originator</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_CLIENT</code></td>
          <td><code class="literal">character_set_client</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION_CONNECTION</code></td>
          <td><a class="link" href="server-administration.html#sysvar_collation_connection"><code class="literal">collation_connection</code></a></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATABASE_COLLATION</code></td>
          <td><code class="literal">Database Collation</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <a class="link" href="information-schema.html#events-table" title="24.7 The INFORMATION_SCHEMA EVENTS Table"><code class="literal">EVENTS</code></a> table is a nonstandard
          table.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_CATALOG</code>: The value of this column is
          always <code class="literal">def</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_SCHEMA</code>: The name of the schema
          (database) to which this event belongs.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_NAME</code>: The name of the event.
        </p></li><li class="listitem"><p>
          <code class="literal">DEFINER</code>: The account of the user who
          created the event, in
          <code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
          format.
        </p></li><li class="listitem"><p>
          <code class="literal">TIME_ZONE</code>: The event time zone, which is
          the time zone used for scheduling the event and that is in
          effect within the event as it executes. The default value is
          <code class="literal">SYSTEM</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_BODY</code>: The language used for the
          statements in the event's <a class="link" href="sql-syntax.html#do" title="13.2.3 DO Syntax"><code class="literal">DO</code></a>
          clause; in MySQL 5.7, this is always
          <code class="literal">SQL</code>.
        </p><p>
          This column is not to be confused with the column of the same
          name (now named <code class="literal">EVENT_DEFINITION</code>) that
          existed in earlier MySQL versions.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_DEFINITION</code>: The text of the SQL
          statement making up the event's
          <a class="link" href="sql-syntax.html#do" title="13.2.3 DO Syntax"><code class="literal">DO</code></a> clause; in other words, the
          statement executed by this event.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_TYPE</code>: The event repetition type,
          either <code class="literal">ONE TIME</code> (transient) or
          <code class="literal">RECURRING</code> (repeating).
        </p></li><li class="listitem"><p>
          <code class="literal">EXECUTE_AT</code>: For a one-time event, this is
          the <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">DATETIME</code></a> value specified in
          the <code class="literal">AT</code> clause of the
          <a class="link" href="sql-syntax.html#create-event" title="13.1.12 CREATE EVENT Syntax"><code class="literal">CREATE EVENT</code></a> statement used to
          create the event, or of the last <a class="link" href="sql-syntax.html#alter-event" title="13.1.2 ALTER EVENT Syntax"><code class="literal">ALTER
          EVENT</code></a> statement that modified the event. The value
          shown in this column reflects the addition or subtraction of
          any <code class="literal">INTERVAL</code> value included in the event's
          <code class="literal">AT</code> clause. For example, if an event is
          created using <code class="literal">ON SCHEDULE AT CURRENT_TIMESTAMP +
          '1:6' DAY_HOUR</code>, and the event was created at
          2006-02-09 14:05:30, the value shown in this column would be
          <code class="literal">'2006-02-10 20:05:30'</code>.
        </p><p>
          If the event's timing is determined by an
          <code class="literal">EVERY</code> clause instead of an
          <code class="literal">AT</code> clause (that is, if the event is
          recurring), the value of this column is
          <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">INTERVAL_VALUE</code>: For recurring events, this
          column contains the numeric portion of the event's
          <code class="literal">EVERY</code> clause.
        </p><p>
          For a one-time event (that is, an event whose timing is
          determined by an <code class="literal">AT</code> clause), this column is
          <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">INTERVAL_FIELD</code>: For recurring events, this
          column contains the units portion of the
          <code class="literal">EVERY</code> clause governing the timing of the
          event. Thus, this column contains a value such as
          '<a class="link" href="data-types.html#year" title="11.3.3 The YEAR Type"><code class="literal">YEAR</code></a>',
          '<code class="literal">QUARTER</code>', '<code class="literal">DAY</code>', and so
          on.
        </p><p>
          For a one-time event (that is, an event whose timing is
          determined by an <code class="literal">AT</code> clause), this column is
          <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">SQL_MODE</code>: The SQL mode in effect when the
          event was created or altered, and under which the event
          executes. For the permitted values, see
          <a class="xref" href="server-administration.html#sql-mode" title="5.1.10 Server SQL Modes">Section 5.1.10, “Server SQL Modes”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">STARTS</code>: For a recurring event whose
          definition includes a <code class="literal">STARTS</code> clause, this
          column contains the corresponding
          <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">DATETIME</code></a> value. As with the
          <code class="literal">EXECUTE_AT</code> column, this value resolves any
          expressions used.
        </p><p>
          If there is no <code class="literal">STARTS</code> clause affecting the
          timing of the event, this column is <code class="literal">NULL</code>
        </p></li><li class="listitem"><p>
          <code class="literal">ENDS</code>: For a recurring event whose
          definition includes a <code class="literal">ENDS</code> clause, this
          column contains the corresponding
          <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">DATETIME</code></a> value. As with the
          <code class="literal">EXECUTE_AT</code> column, this value resolves any
          expressions used.
        </p><p>
          If there is no <code class="literal">ENDS</code> clause affecting the
          timing of the event, this column is <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">STATUS</code>: One of the three values
          <code class="literal">ENABLED</code>, <code class="literal">DISABLED</code>, or
          <code class="literal">SLAVESIDE_DISABLED</code>.
        </p><p>
          <code class="literal">SLAVESIDE_DISABLED</code> indicates that the
          creation of the event occurred on another MySQL server acting
          as a replication master and was replicated to the current
          MySQL server which is acting as a slave, but the event is not
          presently being executed on the slave. See
          <a class="xref" href="replication.html#replication-features-invoked" title="16.4.1.16 Replication of Invoked Features">Section 16.4.1.16, “Replication of Invoked Features”</a>, for more
          information.
        </p></li><li class="listitem"><p>
          <code class="literal">ON_COMPLETION</code>: One of the two values
          <code class="literal">PRESERVE</code> or <code class="literal">NOT
          PRESERVE</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">CREATED</code>: The date and time when the event
          was created. This is a
          <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a> value.
        </p></li><li class="listitem"><p>
          <code class="literal">LAST_ALTERED</code>: The date and time when the
          event was last modified. This is a
          <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a> value. If the event
          has not been modified since its creation, this column holds
          the same value as the <code class="literal">CREATED</code> column.
        </p></li><li class="listitem"><p>
          <code class="literal">LAST_EXECUTED</code>: The date and time when the
          event last executed. A <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">DATETIME</code></a>
          value. If the event has never executed, this column is
          <code class="literal">NULL</code>.
        </p><p>
          <code class="literal">LAST_EXECUTED</code> indicates when the event
          started. As a result, the <code class="literal">ENDS</code> column is
          never less than <code class="literal">LAST_EXECUTED</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_COMMENT</code>: The text of a comment, if
          the event has one. If not, the value of this column is an
          empty string.
        </p></li><li class="listitem"><p>
          <code class="literal">ORIGINATOR</code>: The server ID of the MySQL
          server on which the event was created; used in replication.
          The default value is 0.
        </p></li><li class="listitem"><p>
          <code class="literal">CHARACTER_SET_CLIENT</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_character_set_client"><code class="literal">character_set_client</code></a>
          system variable when the event was created.
        </p></li><li class="listitem"><p>
          <code class="literal">COLLATION_CONNECTION</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_collation_connection"><code class="literal">collation_connection</code></a>
          system variable when the event was created.
        </p></li><li class="listitem"><p>
          <code class="literal">DATABASE_COLLATION</code>: The collation of the
          database with which the event is associated.
</p></li></ul>
</div>
<p>
      <span class="bold"><strong>Example</strong></span>: Suppose that the user
      <code class="literal">jon@ghidora</code> creates an event named
      <code class="literal">e_daily</code>, and then modifies it a few minutes
      later using an <a class="link" href="sql-syntax.html#alter-event" title="13.1.2 ALTER EVENT Syntax"><code class="literal">ALTER EVENT</code></a>
      statement, as shown here:
    </p><pre data-lang="sql" class="programlisting">
DELIMITER |

CREATE EVENT e_daily
    ON SCHEDULE
      EVERY 1 DAY
    COMMENT 'Saves total number of sessions then clears the table each day'
    DO
      BEGIN
        INSERT INTO site_activity.totals (time, total)
          SELECT CURRENT_TIMESTAMP, COUNT(*)
            FROM site_activity.sessions;
        DELETE FROM site_activity.sessions;
      END |

DELIMITER ;

ALTER EVENT e_daily
    ENABLE;
</pre><p>
      (Note that comments can span multiple lines.)
    </p><p>
      This user can then run the following
      <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> statement, and obtain the
      output shown:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.EVENTS</code></strong>
     &gt; <strong class="userinput"><code>WHERE EVENT_NAME = 'e_daily'</code></strong>
     &gt; <strong class="userinput"><code>AND EVENT_SCHEMA = 'myschema'\G</code></strong>
*************************** 1. row ***************************
       EVENT_CATALOG: def
        EVENT_SCHEMA: test
          EVENT_NAME: e_daily
             DEFINER: me@localhost
           TIME_ZONE: SYSTEM
          EVENT_BODY: SQL
    EVENT_DEFINITION: BEGIN
        INSERT INTO site_activity.totals (time, total)
          SELECT CURRENT_TIMESTAMP, COUNT(*)
            FROM site_activity.sessions;
        DELETE FROM site_activity.sessions;
      END
          EVENT_TYPE: RECURRING
          EXECUTE_AT: NULL
      INTERVAL_VALUE: 1
      INTERVAL_FIELD: DAY
            SQL_MODE:
              STARTS: 2008-09-03 12:13:39
                ENDS: NULL
              STATUS: ENABLED
       ON_COMPLETION: NOT PRESERVE
             CREATED: 2008-09-03 12:13:39
        LAST_ALTERED: 2008-09-03 12:13:39
       LAST_EXECUTED: NULL
       EVENT_COMMENT: Saves total number of sessions then clears the
                      table each day
          ORIGINATOR: 1
CHARACTER_SET_CLIENT: latin1
COLLATION_CONNECTION: latin1_swedish_ci
  DATABASE_COLLATION: latin1_swedish_ci
</pre><p>
      Times in the <a class="link" href="information-schema.html#events-table" title="24.7 The INFORMATION_SCHEMA EVENTS Table"><code class="literal">EVENTS</code></a> table are
      displayed using the event time zone or the current session time
      zone, as described in <a class="xref" href="stored-programs-views.html#events-metadata" title="23.4.4 Event Metadata">Section 23.4.4, “Event Metadata”</a>.
    </p><p>
      See also <a class="xref" href="sql-syntax.html#show-events" title="13.7.5.18 SHOW EVENTS Syntax">Section 13.7.5.18, “SHOW EVENTS Syntax”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="files-table"></a>24.8 The INFORMATION_SCHEMA FILES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710593339520"></a><a class="indexterm" name="idm140710593338048"></a><p>
      The <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a> table provides information
      about the files in which MySQL tablespace data is stored.
    </p><p>
      <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a> provides
      information about <code class="literal">InnoDB</code> data files. In NDB
      Cluster this table also provides information about the files in
      which NDB Cluster Disk Data tables are stored. For information
      specific to <code class="literal">InnoDB</code>, see
      <a class="xref" href="information-schema.html#files-table-innodb-notes" title="InnoDB Notes">InnoDB Notes</a>, later in this section;
      for information specific to NDB Cluster, see
      <a class="xref" href="information-schema.html#files-table-ndb-notes" title="NDB Notes">NDB Notes</a>.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA FILES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">FILE_ID</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">FILE_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">FILE_TYPE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLESPACE_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOGFILE_GROUP_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOGFILE_GROUP_NUMBER</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ENGINE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">FULLTEXT_KEYS</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DELETED_ROWS</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">UPDATE_COUNT</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">FREE_EXTENTS</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TOTAL_EXTENTS</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EXTENT_SIZE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INITIAL_SIZE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAXIMUM_SIZE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">AUTOEXTEND_SIZE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATION_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LAST_UPDATE_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LAST_ACCESS_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">RECOVER_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRANSACTION_COUNTER</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">VERSION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ROW_FORMAT</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_ROWS</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">AVG_ROW_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAX_DATA_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_FREE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATE_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">UPDATE_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHECK_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHECKSUM</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">STATUS</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EXTRA</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<h3><a name="files-table-innodb-notes"></a>InnoDB Notes</h3>
<p>
      The following notes apply to <code class="literal">InnoDB</code> data files.
      <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a> fields that
      are not described below are not applicable to
      <code class="literal">InnoDB</code> and report a <code class="literal">NULL</code>
      value.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Data reported by
          <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a> is
          reported from the <code class="literal">InnoDB</code> in-memory cache
          for open files. By comparison,
          <a class="link" href="information-schema.html#innodb-sys-datafiles-table" title="24.31.17 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table"><code class="literal">INFORMATION_SCHEMA.INNODB_SYS_DATAFILES</code></a>
          reports data from the <code class="literal">InnoDB</code>
          <code class="literal">SYS_DATAFILES</code> internal data dictionary
          table.
        </p></li><li class="listitem"><p>
          The data reported by
          <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a> includes
          temporary tablespace data. This data is not available in the
          internal <code class="literal">SYS_DATAFILES</code> data dictionary
          table, and is therefore not reported by
          <a class="link" href="information-schema.html#innodb-sys-datafiles-table" title="24.31.17 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table"><code class="literal">INNODB_SYS_DATAFILES</code></a>.
        </p></li><li class="listitem"><p>
          Undo tablespace data is reported by
          <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a>.
        </p></li><li class="listitem"><p>
          <code class="literal">FILE_ID</code> is the tablespace ID, also referred
          to as the <code class="literal">space_id</code> or
          <code class="literal">fil_space_t::id</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">FILE_NAME</code> is the name of the data file.
          File-per-table and general tablespaces have a
          <code class="filename">.ibd</code> file name extension. Undo
          tablespaces are prefixed by <code class="literal">undo</code>. The
          system tablespace is prefixed by <code class="literal">ibdata</code>.
          Temporary tablespaces are prefixed by
          <code class="literal">ibtmp</code>. The file name includes the file
          path, which may be relative to the MySQL data directory
          (<a class="link" href="server-administration.html#sysvar_datadir"><code class="literal">datadir</code></a>).
        </p></li><li class="listitem"><p>
          <code class="literal">FILE_TYPE</code> is the tablespace file type.
          There are three possible file types for
          <code class="literal">InnoDB</code> files. <code class="literal">TABLESPACE</code>
          is the file type for any system, general, or file-per-table
          tablespace file that holds tables, indexes, or other forms of
          user data. <code class="literal">TEMPORARY</code> is the file type for
          temporary tablespaces. <code class="literal">UNDO LOG</code> is the file
          type for undo tablespaces, which hold undo records.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLESPACE_NAME</code> is the SQL name for the
          tablespace. A general tablespace name is the
          <code class="literal">SYS_TABLESPACES.NAME</code> value. For other
          tablespace files, names start with <code class="literal">innodb_</code>,
          such as <code class="literal">innodb_system</code>,
          <code class="literal">innodb_undo</code>, and
          <code class="literal">innodb_file_per_table</code>. The file-per-table
          tablespace name format is
          <code class="literal">innodb_file_per_table_<em class="replaceable"><code>##</code></em></code>,
          where <em class="replaceable"><code>##</code></em> is the tablespace ID.
        </p></li><li class="listitem"><p>
          <code class="literal">ENGINE</code> is the storage engine. For
          <code class="literal">InnoDB</code> files, the value is always
          <code class="literal">InnoDB</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">FREE_EXTENTS</code> is the number of fully free
          extents in the current data file.
        </p></li><li class="listitem"><p>
          <code class="literal">TOTAL_EXTENTS</code> is the number of full extents
          used in the current data file. Any partial extent at the end
          of the file is not counted.
        </p></li><li class="listitem"><p>
          <code class="literal">EXTENT_SIZE</code> is 1048576 (1MB) for files with
          a 4k, 8k, or 16k page size. Extent size is 2097152 bytes (2MB)
          for files with a 32k page size, and 4194304 (4MB) for files
          with a 64k page size.
          <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a> does not
          report <code class="literal">InnoDB</code> page size. Page size is
          defined by the
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_page_size"><code class="literal">innodb_page_size</code></a> option.
          Extent size information can also be retrieved from
          <a class="link" href="information-schema.html#innodb-sys-tablespaces-table" title="24.31.23 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table"><code class="literal">INNODB_SYS_TABLESPACES</code></a> where
          <code class="literal">FILES.FILE_ID =
          INNODB_SYS_TABLESPACES.SPACE_ID</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">INITIAL_SIZE</code> is the initial size of the
          file, in bytes.
        </p></li><li class="listitem"><p>
          <code class="literal">MAXIMUM_SIZE</code> is the maximum number of bytes
          allowed in the file. The value is <code class="literal">NULL</code> for
          all data files except for predefined system tablespace data
          files. Maximum system tablespace file size is defined by
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_data_file_path"><code class="literal">innodb_data_file_path</code></a>.
          Maximum temporary tablespace file size is defined by
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_temp_data_file_path"><code class="literal">innodb_temp_data_file_path</code></a>. A
          <code class="literal">NULL</code> value for a predefined system
          tablespace data file indicates that a file size limit was not
          defined explicitly.
        </p></li><li class="listitem"><p>
          <code class="literal">AUTOEXTEND_SIZE</code> is the auto-extend size
          defined by
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_data_file_path"><code class="literal">innodb_data_file_path</code></a> for the
          system tablespace, or defined by
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_temp_data_file_path"><code class="literal">innodb_temp_data_file_path</code></a>
          for temporary tablespaces.
        </p></li><li class="listitem"><p>
          <code class="literal">DATA_FREE</code> is the total amount of free space
          (in bytes) for the entire tablespace. Predefined system
          tablespaces, which include the system tablespace and temporary
          table tablespaces, may have one or more data files.
        </p></li><li class="listitem"><p>
          <code class="literal">STATUS</code> is <code class="literal">NORMAL</code> by
          default. <code class="literal">InnoDB</code> file-per-table tablespaces
          may report <code class="literal">IMPORTING</code>, which indicates that
          the tablespace is not yet available.
        </p></li><li class="listitem"><p>
          The following query returns all data pertinent to
          <code class="literal">InnoDB</code> tablespaces.
        </p><pre data-lang="sql" class="programlisting">mysql&gt;SELECT FILE_ID, FILE_NAME, FILE_TYPE, TABLESPACE_NAME, FREE_EXTENTS, TOTAL_EXTENTS,
EXTENT_SIZE, INITIAL_SIZE, MAXIMUM_SIZE, AUTOEXTEND_SIZE, DATA_FREE, STATUS ENGINE
FROM INFORMATION_SCHEMA.FILES \G</pre></li></ul>
</div>
<h3><a name="files-table-ndb-notes"></a>NDB Notes</h3>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <code class="literal">FILES</code> table provides information about
          Disk Data <span class="emphasis"><em>files</em></span> only; you cannot use it
          for determining disk space allocation or availability for
          individual <code class="literal">NDB</code> tables. However, it is
          possible to see how much space is allocated for each
          <a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> table having data stored on
          disk—as well as how much remains available for storage
          of data on disk for that table—using
          <a class="link" href="mysql-cluster.html#mysql-cluster-programs-ndb-desc" title="21.4.10 ndb_desc — Describe NDB Tables"><span class="command"><strong>ndb_desc</strong></span></a>. For more information, see
          <a class="xref" href="mysql-cluster.html#mysql-cluster-programs-ndb-desc" title="21.4.10 ndb_desc — Describe NDB Tables">Section 21.4.10, “<span class="command"><strong>ndb_desc</strong></span> — Describe NDB Tables”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">FILE_ID</code> column values are auto-generated.
        </p></li><li class="listitem"><p>
          <code class="literal">FILE_NAME</code> is the name of an
          <code class="literal">UNDO</code> log file created by
          <a class="link" href="sql-syntax.html#create-logfile-group" title="13.1.15 CREATE LOGFILE GROUP Syntax"><code class="literal">CREATE LOGFILE GROUP</code></a> or
          <a class="link" href="sql-syntax.html#alter-logfile-group" title="13.1.5 ALTER LOGFILE GROUP Syntax"><code class="literal">ALTER LOGFILE GROUP</code></a>, or of a
          data file created by <a class="link" href="sql-syntax.html#create-tablespace" title="13.1.19 CREATE TABLESPACE Syntax"><code class="literal">CREATE
          TABLESPACE</code></a> or <a class="link" href="sql-syntax.html#alter-tablespace" title="13.1.9 ALTER TABLESPACE Syntax"><code class="literal">ALTER
          TABLESPACE</code></a>.
        </p></li><li class="listitem"><p>
          <code class="literal">FILE_TYPE</code> is one of the values
          <code class="literal">UNDOFILE</code>, <code class="literal">DATAFILE</code>, or
          <code class="literal">TABLESPACE</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLESPACE_NAME</code> is the name of the
          tablespace with which the file is associated.
        </p></li><li class="listitem"><p>
          Currently, the value of the
          <code class="literal">TABLESPACE_CATALOG</code> column is always
          <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_NAME</code> is the name of the Disk Data
          table with which the file is associated, if any.
        </p></li><li class="listitem"><p>
          The <code class="literal">LOGFILE_GROUP_NAME</code> column gives the
          name of the log file group to which the log file or data file
          belongs.
        </p></li><li class="listitem"><p>
          For an <code class="literal">UNDO</code> log file, the
          <code class="literal">LOGFILE_GROUP_NUMBER</code> contains the
          auto-generated ID number of the log file group to which the
          log file belongs.
        </p></li><li class="listitem"><p>
          For an NDB Cluster Disk Data log file or data file, the value
          of the <code class="literal">ENGINE</code> column is always
          <a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> or
          <a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDBCLUSTER</code></a>.
        </p></li><li class="listitem"><p>
          For an NDB Cluster Disk Data log file or data file, the value
          of the <code class="literal">FULLTEXT_KEYS</code> column is always
          empty.
        </p></li><li class="listitem"><p>
          The <code class="literal">FREE EXTENTS</code> column displays the number
          of extents which have not yet been used by the file. The
          <code class="literal">TOTAL EXTENTS</code> column show the total number
          of extents allocated to the file.
        </p><p>
          The difference between these two columns is the number of
          extents currently in use by the file:
        </p><pre data-lang="sql" class="programlisting">
SELECT TOTAL_EXTENTS - FREE_EXTENTS AS extents_used
    FROM INFORMATION_SCHEMA.FILES
    WHERE FILE_NAME = 'myfile.dat';
</pre><p>
          You can approximate the amount of disk space in use by the
          file by multiplying this difference by the value of the
          <code class="literal">EXTENT_SIZE</code> column, which gives the size of
          an extent for the file in bytes:
        </p><pre data-lang="sql" class="programlisting">
SELECT (TOTAL_EXTENTS - FREE_EXTENTS) * EXTENT_SIZE AS bytes_used
    FROM INFORMATION_SCHEMA.FILES
    WHERE FILE_NAME = 'myfile.dat';
</pre><p>
          Similarly, you can estimate the amount of space that remains
          available in a given file by multiplying
          <code class="literal">FREE_EXTENTS</code> by
          <code class="literal">EXTENT_SIZE</code>:
        </p><pre data-lang="sql" class="programlisting">
SELECT FREE_EXTENTS * EXTENT_SIZE AS bytes_free
    FROM INFORMATION_SCHEMA.FILES
    WHERE FILE_NAME = 'myfile.dat';
</pre>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
            The byte values produced by the preceding queries are
            approximations only, and their precision is inversely
            proportional to the value of <code class="literal">EXTENT_SIZE</code>.
            That is, the larger <code class="literal">EXTENT_SIZE</code> becomes,
            the less accurate the approximations are.
</p>
</div>
<p>
          It is also important to remember that once an extent is used,
          it cannot be freed again without dropping the data file of
          which it is a part. This means that deletes from a Disk Data
          table do <span class="emphasis"><em>not</em></span> release disk space.
        </p><p>
          The extent size can be set in a <a class="link" href="sql-syntax.html#create-tablespace" title="13.1.19 CREATE TABLESPACE Syntax"><code class="literal">CREATE
          TABLESPACE</code></a> statement. See
          <a class="xref" href="sql-syntax.html#create-tablespace" title="13.1.19 CREATE TABLESPACE Syntax">Section 13.1.19, “CREATE TABLESPACE Syntax”</a>, for more information.
        </p></li><li class="listitem"><p>
          The <code class="literal">INITIAL_SIZE</code> column shows the size in
          bytes of the file. This is the same value that was used in the
          <code class="literal">INITIAL_SIZE</code> clause of the
          <a class="link" href="sql-syntax.html#create-logfile-group" title="13.1.15 CREATE LOGFILE GROUP Syntax"><code class="literal">CREATE LOGFILE GROUP</code></a>,
          <a class="link" href="sql-syntax.html#alter-logfile-group" title="13.1.5 ALTER LOGFILE GROUP Syntax"><code class="literal">ALTER LOGFILE GROUP</code></a>,
          <a class="link" href="sql-syntax.html#create-tablespace" title="13.1.19 CREATE TABLESPACE Syntax"><code class="literal">CREATE TABLESPACE</code></a>, or
          <a class="link" href="sql-syntax.html#alter-tablespace" title="13.1.9 ALTER TABLESPACE Syntax"><code class="literal">ALTER TABLESPACE</code></a> statement used
          to create the file.
        </p><p>
          For NDB Cluster Disk Data files, the value of the
          <code class="literal">MAXIMUM_SIZE</code> column is always the same as
          <code class="literal">INITIAL_SIZE</code>, and the
          <code class="literal">AUTOEXTEND_SIZE</code> column is always empty.
        </p></li><li class="listitem"><p>
          The <code class="literal">CREATION_TIME</code> column shows the date and
          time when the file was created. The
          <code class="literal">LAST_UPDATE_TIME</code> column displays the date
          and time when the file was last modified. The
          <code class="literal">LAST_ACCESSED</code> column provides the date and
          time when the file was last accessed by the server.
        </p><p>
          Currently, the values of these columns are as reported by the
          operating system, and are not supplied by the
          <a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> storage engine. Where no
          value is provided by the operating system, these columns
          display <code class="literal">0000-00-00 00:00:00</code>.
        </p></li><li class="listitem"><p>
          For NDB Cluster Disk Data files, the value of the
          <code class="literal">RECOVER_TIME</code> and
          <code class="literal">TRANSACTION_COUNTER</code> columns is always
          <code class="literal">0</code>.
        </p></li><li class="listitem"><p>
          For NDB Cluster Disk Data files, the following columns are
          always <code class="literal">NULL</code>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">VERSION</code>
            </p></li><li class="listitem"><p>
              <code class="literal">ROW_FORMAT</code>
            </p></li><li class="listitem"><p>
              <code class="literal">TABLE_ROWS</code>
            </p></li><li class="listitem"><p>
              <code class="literal">AVG_ROW_LENGTH</code>
            </p></li><li class="listitem"><p>
              <code class="literal">DATA_LENGTH</code>
            </p></li><li class="listitem"><p>
              <code class="literal">MAX_DATA_LENGTH</code>
            </p></li><li class="listitem"><p>
              <code class="literal">INDEX_LENGTH</code>
            </p></li><li class="listitem"><p>
              <code class="literal">DATA_FREE</code>
            </p></li><li class="listitem"><p>
              <code class="literal">CREATE_TIME</code>
            </p></li><li class="listitem"><p>
              <code class="literal">UPDATE_TIME</code>
            </p></li><li class="listitem"><p>
              <code class="literal">CHECK_TIME</code>
            </p></li><li class="listitem"><p>
              <code class="literal">CHECKSUM</code>
</p></li></ul>
</div>
</li><li class="listitem"><p>
          For NDB Cluster Disk Data files, the value of the
          <code class="literal">STATUS</code> column is always
          <code class="literal">NORMAL</code>.
        </p></li><li class="listitem"><p>
          For NDB Cluster Disk Data files, the <code class="literal">EXTRA</code>
          column shows which data node the file belongs to, as each data
          node has its own copy of the file. Suppose that you use this
          statement on an NDB Cluster with four data nodes:
        </p><pre data-lang="sql" class="programlisting">
CREATE LOGFILE GROUP mygroup
    ADD UNDOFILE 'new_undo.dat'
    INITIAL_SIZE 2G
    ENGINE NDB;
</pre><p>
          After running the <a class="link" href="sql-syntax.html#create-logfile-group" title="13.1.15 CREATE LOGFILE GROUP Syntax"><code class="literal">CREATE LOGFILE
          GROUP</code></a> statement successfully, you should see a
          result similar to the one shown here for this query against
          the <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a> table:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT LOGFILE_GROUP_NAME, FILE_TYPE, EXTRA</code></strong>
    -&gt;     <strong class="userinput"><code>FROM INFORMATION_SCHEMA.FILES</code></strong>
    -&gt;     <strong class="userinput"><code>WHERE FILE_NAME = 'new_undo.dat';</code></strong>
+--------------------+-------------+----------------+
| LOGFILE_GROUP_NAME | FILE_TYPE   | EXTRA          |
+--------------------+-------------+----------------+
| mygroup            | UNDO FILE   | CLUSTER_NODE=3 |
| mygroup            | UNDO FILE   | CLUSTER_NODE=4 |
| mygroup            | UNDO FILE   | CLUSTER_NODE=5 |
| mygroup            | UNDO FILE   | CLUSTER_NODE=6 |
+--------------------+-------------+----------------+
4 rows in set (0.01 sec)
</pre></li><li class="listitem"><p>
          The <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a> table is a nonstandard
          table.
        </p></li><li class="listitem"><p>
          An additional row is present in the
          <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a> table following the
          creation of a logfile group. This row has
          <code class="literal">NULL</code> for the value of the
          <code class="literal">FILE_NAME</code> column. For this row, the value
          of the <code class="literal">FILE_ID</code> column is always
          <code class="literal">0</code>, that of the <code class="literal">FILE_TYPE</code>
          column is always <code class="literal">UNDO FILE</code>, and that of the
          <code class="literal">STATUS</code> column is always
          <code class="literal">NORMAL</code>. Currently, the value of the
          <code class="literal">ENGINE</code> column is always
          <a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDBCLUSTER</code></a>.
        </p><p>
          The <code class="literal">FREE_EXTENTS</code> column in this row shows
          the total number of free extents available to all undo files
          belonging to a given log file group whose name and number are
          shown in the <code class="literal">LOGFILE_GROUP_NAME</code> and
          <code class="literal">LOGFILE_GROUP_NUMBER</code> columns, respectively.
        </p><p>
          Suppose there are no existing log file groups on your NDB
          Cluster, and you create one using the following statement:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CREATE LOGFILE GROUP lg1</code></strong>
    -&gt;   <strong class="userinput"><code>ADD UNDOFILE 'undofile.dat'</code></strong>
    -&gt;   <strong class="userinput"><code>INITIAL_SIZE = 16M</code></strong>
    -&gt;   <strong class="userinput"><code>UNDO_BUFFER_SIZE = 1M</code></strong>
    -&gt;   <strong class="userinput"><code>ENGINE = NDB;</code></strong>
Query OK, 0 rows affected (3.81 sec)
</pre><p>
          You can now see this <code class="literal">NULL</code> row when you
          query the <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a> table:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT DISTINCT</code></strong>
    -&gt;   <strong class="userinput"><code>FILE_NAME AS File,</code></strong>
    -&gt;   <strong class="userinput"><code>FREE_EXTENTS AS Free,</code></strong>
    -&gt;   <strong class="userinput"><code>TOTAL_EXTENTS AS Total,</code></strong>
    -&gt;   <strong class="userinput"><code>EXTENT_SIZE AS Size,</code></strong>
    -&gt;   <strong class="userinput"><code>INITIAL_SIZE AS Initial</code></strong>
    -&gt;   <strong class="userinput"><code>FROM INFORMATION_SCHEMA.FILES;</code></strong>
+--------------+---------+---------+------+----------+
| File         | Free    | Total   | Size | Initial  |
+--------------+---------+---------+------+----------+
| undofile.dat |    NULL | 4194304 |    4 | 16777216 |
| NULL         | 4184068 |    NULL |    4 |     NULL |
+--------------+---------+---------+------+----------+
2 rows in set (0.01 sec)
</pre><p>
          The total number of free extents available for undo logging is
          always somewhat less than the sum of the
          <code class="literal">TOTAL_EXTENTS</code> column values for all undo
          files in the log file group due to overhead required for
          maintaining the undo files. This can be seen by adding a
          second undo file to the log file group, then repeating the
          previous query against the <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a>
          table:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>ALTER LOGFILE GROUP lg1</code></strong>
    -&gt;   <strong class="userinput"><code>ADD UNDOFILE 'undofile02.dat'</code></strong>
    -&gt;   <strong class="userinput"><code>INITIAL_SIZE = 4M</code></strong>
    -&gt;   <strong class="userinput"><code>ENGINE = NDB;</code></strong>
Query OK, 0 rows affected (1.02 sec)

mysql&gt; <strong class="userinput"><code>SELECT DISTINCT</code></strong>
    -&gt;   <strong class="userinput"><code>FILE_NAME AS File,</code></strong>
    -&gt;   <strong class="userinput"><code>FREE_EXTENTS AS Free,</code></strong>
    -&gt;   <strong class="userinput"><code>TOTAL_EXTENTS AS Total,</code></strong>
    -&gt;   <strong class="userinput"><code>EXTENT_SIZE AS Size,</code></strong>
    -&gt;   <strong class="userinput"><code>INITIAL_SIZE AS Initial</code></strong>
    -&gt;   <strong class="userinput"><code>FROM INFORMATION_SCHEMA.FILES;</code></strong>
+----------------+---------+---------+------+----------+
| File           | Free    | Total   | Size | Initial  |
+----------------+---------+---------+------+----------+
| undofile.dat   |    NULL | 4194304 |    4 | 16777216 |
| undofile02.dat |    NULL | 1048576 |    4 |  4194304 |
| NULL           | 5223944 |    NULL |    4 |     NULL |
+----------------+---------+---------+------+----------+
3 rows in set (0.01 sec)
</pre><p>
          The amount of free space in bytes which is available for undo
          logging by Disk Data tables using this log file group can be
          approximated by multiplying the number of free extents by the
          initial size:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT</code></strong>
    -&gt;   <strong class="userinput"><code>FREE_EXTENTS AS 'Free Extents',</code></strong>
    -&gt;   <strong class="userinput"><code>FREE_EXTENTS * EXTENT_SIZE AS 'Free Bytes'</code></strong>
    -&gt;   <strong class="userinput"><code>FROM INFORMATION_SCHEMA.FILES</code></strong>
    -&gt;   <strong class="userinput"><code>WHERE LOGFILE_GROUP_NAME = 'lg1'</code></strong>
    -&gt;   <strong class="userinput"><code>AND FILE_NAME IS NULL;</code></strong>
+--------------+------------+
| Free Extents | Free Bytes |
+--------------+------------+
|      5223944 |   20895776 |
+--------------+------------+
1 row in set (0.02 sec)
</pre><p>
          If you create an NDB Cluster Disk Data table and then insert
          some rows into it, you can see approximately how much space
          remains for undo logging afterward, for example:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CREATE TABLESPACE ts1</code></strong>
    -&gt;   <strong class="userinput"><code>ADD DATAFILE 'data1.dat'</code></strong>
    -&gt;   <strong class="userinput"><code>USE LOGFILE GROUP lg1</code></strong>
    -&gt;   <strong class="userinput"><code>INITIAL_SIZE 512M</code></strong>
    -&gt;   <strong class="userinput"><code>ENGINE = NDB;</code></strong>
Query OK, 0 rows affected (8.71 sec)

mysql&gt; <strong class="userinput"><code>CREATE TABLE dd (</code></strong>
    -&gt;   <strong class="userinput"><code>c1 INT NOT NULL PRIMARY KEY,</code></strong>
    -&gt;   <strong class="userinput"><code>c2 INT,</code></strong>
    -&gt;   <strong class="userinput"><code>c3 DATE</code></strong>
    -&gt;   <strong class="userinput"><code>)</code></strong>
    -&gt;   <strong class="userinput"><code>TABLESPACE ts1 STORAGE DISK</code></strong>
    -&gt;   <strong class="userinput"><code>ENGINE = NDB;</code></strong>
Query OK, 0 rows affected (2.11 sec)

mysql&gt; <strong class="userinput"><code>INSERT INTO dd VALUES</code></strong>
    -&gt;   <strong class="userinput"><code>(NULL, 1234567890, '2007-02-02'),</code></strong>
    -&gt;   <strong class="userinput"><code>(NULL, 1126789005, '2007-02-03'),</code></strong>
    -&gt;   <strong class="userinput"><code>(NULL, 1357924680, '2007-02-04'),</code></strong>
    -&gt;   <strong class="userinput"><code>(NULL, 1642097531, '2007-02-05');</code></strong>
Query OK, 4 rows affected (0.01 sec)

mysql&gt; <strong class="userinput"><code>SELECT</code></strong>
    -&gt;   <strong class="userinput"><code>FREE_EXTENTS AS 'Free Extents',</code></strong>
    -&gt;   <strong class="userinput"><code>FREE_EXTENTS * EXTENT_SIZE AS 'Free Bytes'</code></strong>
    -&gt;   <strong class="userinput"><code>FROM INFORMATION_SCHEMA.FILES</code></strong>
    -&gt;   <strong class="userinput"><code>WHERE LOGFILE_GROUP_NAME = 'lg1'</code></strong>
    -&gt;   <strong class="userinput"><code>AND FILE_NAME IS NULL;</code></strong>
+--------------+------------+
| Free Extents | Free Bytes |
+--------------+------------+
|      5207565 |   20830260 |
+--------------+------------+
1 row in set (0.01 sec)
</pre></li><li class="listitem"><p>
          An additional row is present in the
          <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a> table for any NDB Cluster
          tablespace, whether or not any data files are associated with
          the tablespace. This row has <code class="literal">NULL</code> for the
          value of the <code class="literal">FILE_NAME</code> column. For this
          row, the value of the <code class="literal">FILE_ID</code> column is
          always <code class="literal">0</code>, that of the
          <code class="literal">FILE_TYPE</code> column is always
          <code class="literal">TABLESPACE</code>, and that of the
          <code class="literal">STATUS</code> column is always
          <code class="literal">NORMAL</code>. Currently, the value of the
          <code class="literal">ENGINE</code> column is always
          <a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDBCLUSTER</code></a>.
        </p></li><li class="listitem"><p>
          There are no <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements
          associated with the <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">FILES</code></a> table.
        </p></li><li class="listitem"><p>
          For additional information, and examples of creating and
          dropping NDB Cluster Disk Data objects, see
          <a class="xref" href="mysql-cluster.html#mysql-cluster-disk-data" title="21.5.13 NDB Cluster Disk Data Tables">Section 21.5.13, “NDB Cluster Disk Data Tables”</a>.
</p></li></ul>
</div>

</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="status-table"></a>24.9 The INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS Tables</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592932816"></a><a class="indexterm" name="idm140710592931344"></a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        As of MySQL 5.7.6, the value of the
        <a class="link" href="server-administration.html#sysvar_show_compatibility_56"><code class="literal">show_compatibility_56</code></a> system
        variable affects the information available from the tables
        described here. For details, see the description of that
        variable in <a class="xref" href="server-administration.html#server-system-variables" title="5.1.7 Server System Variables">Section 5.1.7, “Server System Variables”</a>.
</p>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
        As of MySQL 5.7.6, information available from the tables
        described here is also available from the Performance Schema.
        The <code class="literal">INFORMATION_SCHEMA</code> tables are deprecated
        in preference to the Performance Schema tables and will be
        removed in a future MySQL release. For advice on migrating away
        from the <code class="literal">INFORMATION_SCHEMA</code> tables to the
        Performance Schema tables, see
        <a class="xref" href="performance-schema.html#performance-schema-variable-table-migration" title="25.19 Migrating to Performance Schema System and Status Variable Tables">Section 25.19, “Migrating to Performance Schema System and Status Variable Tables”</a>.
</p>
</div>
<p>
      The <a class="link" href="information-schema.html#status-table" title="24.9 The INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS Tables"><code class="literal">GLOBAL_STATUS</code></a>
      and <a class="link" href="information-schema.html#status-table" title="24.9 The INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS Tables"><code class="literal">SESSION_STATUS</code></a>
      tables provide information about server status variables. Their
      contents correspond to the information produced by the
      <a class="link" href="sql-syntax.html#show-status" title="13.7.5.35 SHOW STATUS Syntax"><code class="literal">SHOW GLOBAL
      STATUS</code></a> and
      <a class="link" href="sql-syntax.html#show-status" title="13.7.5.35 SHOW STATUS Syntax"><code class="literal">SHOW SESSION
      STATUS</code></a> statements (see <a class="xref" href="sql-syntax.html#show-status" title="13.7.5.35 SHOW STATUS Syntax">Section 13.7.5.35, “SHOW STATUS Syntax”</a>).
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA GLOBAL_STATUS and SESSION_STATUS tables."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row">VARIABLE_NAME</td>
          <td>Variable_name</td>
          <td></td>
        </tr><tr>
          <td scope="row">VARIABLE_VALUE</td>
          <td>Value</td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <code class="literal">VARIABLE_VALUE</code> column for each of these
          tables is defined as <code class="literal">VARCHAR(1024)</code>.
</p></li></ul>
</div>

</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="variables-table"></a>24.10 The INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES Tables</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592896992"></a><a class="indexterm" name="idm140710592895520"></a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        As of MySQL 5.7.6, the value of the
        <a class="link" href="server-administration.html#sysvar_show_compatibility_56"><code class="literal">show_compatibility_56</code></a> system
        variable affects the information available from the tables
        described here. For details, see the description of that
        variable in <a class="xref" href="server-administration.html#server-system-variables" title="5.1.7 Server System Variables">Section 5.1.7, “Server System Variables”</a>.
</p>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
        As of MySQL 5.7.6, information available from the tables
        described here is also available from the Performance Schema.
        The <code class="literal">INFORMATION_SCHEMA</code> tables are deprecated
        in preference to the Performance Schema tables and will be
        removed in a future MySQL release. For advice on migrating away
        from the <code class="literal">INFORMATION_SCHEMA</code> tables to the
        Performance Schema tables, see
        <a class="xref" href="performance-schema.html#performance-schema-variable-table-migration" title="25.19 Migrating to Performance Schema System and Status Variable Tables">Section 25.19, “Migrating to Performance Schema System and Status Variable Tables”</a>.
</p>
</div>
<p>
      The
      <a class="link" href="information-schema.html#variables-table" title="24.10 The INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES Tables"><code class="literal">GLOBAL_VARIABLES</code></a>
      and
      <a class="link" href="information-schema.html#variables-table" title="24.10 The INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES Tables"><code class="literal">SESSION_VARIABLES</code></a>
      tables provide information about server status variables. Their
      contents correspond to the information produced by the
      <a class="link" href="sql-syntax.html#show-variables" title="13.7.5.39 SHOW VARIABLES Syntax"><code class="literal">SHOW GLOBAL
      VARIABLES</code></a> and
      <a class="link" href="sql-syntax.html#show-variables" title="13.7.5.39 SHOW VARIABLES Syntax"><code class="literal">SHOW SESSION
      VARIABLES</code></a> statements (see
      <a class="xref" href="sql-syntax.html#show-variables" title="13.7.5.39 SHOW VARIABLES Syntax">Section 13.7.5.39, “SHOW VARIABLES Syntax”</a>).
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA GLOBAL_VARIABLES and SESSION_VARIABLES tables."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row">VARIABLE_NAME</td>
          <td>Variable_name</td>
          <td></td>
        </tr><tr>
          <td scope="row">VARIABLE_VALUE</td>
          <td>Value</td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <code class="literal">VARIABLE_VALUE</code> column for each of these
          tables is defined as <code class="literal">VARCHAR(1024)</code>. For
          variables with very long values that are not completely
          displayed, use <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> as a
          workaround. For example:
        </p><pre data-lang="sql" class="programlisting">
SELECT @@GLOBAL.innodb_data_file_path;
</pre></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="key-column-usage-table"></a>24.11 The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592858880"></a><p>
      The <a class="link" href="information-schema.html#key-column-usage-table" title="24.11 The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table"><code class="literal">KEY_COLUMN_USAGE</code></a> table describes
      which key columns have constraints.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA KEY_COLUMN_USAGE table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">CONSTRAINT_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">CONSTRAINT_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CONSTRAINT_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ORDINAL_POSITION</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">POSITION_IN_UNIQUE_CONSTRAINT</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">REFERENCED_TABLE_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">REFERENCED_TABLE_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">REFERENCED_COLUMN_NAME</code></td>
          <td></td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If the constraint is a foreign key, then this is the column of
          the foreign key, not the column that the foreign key
          references.
        </p></li><li class="listitem"><p>
          The value of <code class="literal">ORDINAL_POSITION</code> is the
          column's position within the constraint, not the column's
          position within the table. Column positions are numbered
          beginning with 1.
        </p></li><li class="listitem"><p>
          The value of <code class="literal">POSITION_IN_UNIQUE_CONSTRAINT</code>
          is <code class="literal">NULL</code> for unique and primary-key
          constraints. For foreign-key constraints, it is the ordinal
          position in key of the table that is being referenced.
        </p><p>
          Suppose that there are two tables name <code class="literal">t1</code>
          and <code class="literal">t3</code> that have the following definitions:
        </p><pre data-lang="sql" class="programlisting">
CREATE TABLE t1
(
    s1 INT,
    s2 INT,
    s3 INT,
    PRIMARY KEY(s3)
) ENGINE=InnoDB;

CREATE TABLE t3
(
    s1 INT,
    s2 INT,
    s3 INT,
    KEY(s1),
    CONSTRAINT CO FOREIGN KEY (s2) REFERENCES t1(s3)
) ENGINE=InnoDB;
</pre><p>
          For those two tables, the
          <a class="link" href="information-schema.html#key-column-usage-table" title="24.11 The INFORMATION_SCHEMA KEY_COLUMN_USAGE Table"><code class="literal">KEY_COLUMN_USAGE</code></a> table has two
          rows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              One row with <code class="literal">CONSTRAINT_NAME</code> =
              <code class="literal">'PRIMARY'</code>,
              <code class="literal">TABLE_NAME</code> = <code class="literal">'t1'</code>,
              <code class="literal">COLUMN_NAME</code> = <code class="literal">'s3'</code>,
              <code class="literal">ORDINAL_POSITION</code> =
              <code class="literal">1</code>,
              <code class="literal">POSITION_IN_UNIQUE_CONSTRAINT</code> =
              <code class="literal">NULL</code>.
            </p></li><li class="listitem"><p>
              One row with <code class="literal">CONSTRAINT_NAME</code> =
              <code class="literal">'CO'</code>, <code class="literal">TABLE_NAME</code> =
              <code class="literal">'t3'</code>, <code class="literal">COLUMN_NAME</code> =
              <code class="literal">'s2'</code>,
              <code class="literal">ORDINAL_POSITION</code> =
              <code class="literal">1</code>,
              <code class="literal">POSITION_IN_UNIQUE_CONSTRAINT</code> =
              <code class="literal">1</code>.
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="ndb-transid-mysql-connection-map-table"></a>24.12 The INFORMATION_SCHEMA ndb_transid_mysql_connection_map Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592776064"></a><p>
      The <code class="literal">ndb_transid_mysql_connection_map</code> table
      provides a mapping between <code class="literal">NDB</code> transactions,
      <code class="literal">NDB</code> transaction coordinators, and MySQL Servers
      attached to an NDB Cluster as API nodes. This information is used
      when populating the
      <a class="link" href="mysql-cluster.html#mysql-cluster-ndbinfo-server-operations" title="21.5.10.34 The ndbinfo server_operations Table"><code class="literal">server_operations</code></a> and
      <a class="link" href="mysql-cluster.html#mysql-cluster-ndbinfo-server-transactions" title="21.5.10.35 The ndbinfo server_transactions Table"><code class="literal">server_transactions</code></a> tables of
      the <a class="link" href="mysql-cluster.html#mysql-cluster-ndbinfo" title="21.5.10 ndbinfo: The NDB Cluster Information Database"><code class="literal">ndbinfo</code></a> NDB Cluster
      information database.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA ndb_transid_mysql_connection_map table. The table lists INFORMATION_SCHEMA names along with corresponding SHOW names (if applicable), and remarks."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">mysql_connection_id</code></td>
          <td></td>
          <td>MySQL Server connection ID</td>
        </tr><tr>
          <td scope="row"><code class="literal">node_id</code></td>
          <td></td>
          <td>Transaction coordinator node ID</td>
        </tr><tr>
          <td scope="row"><code class="literal">ndb_transid</code></td>
          <td></td>
          <td><a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> transaction ID</td>
</tr></tbody></table>
</div>
<p>
      The <code class="literal">mysql_connection_id</code> is the same as the
      connection or session ID shown in the output of
      <a class="link" href="sql-syntax.html#show-processlist" title="13.7.5.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW PROCESSLIST</code></a>.
    </p><p>
      There are no <code class="literal">SHOW</code> statements associated with
      this table.
    </p><p>
      This is a nonstandard table, specific to NDB Cluster. It is
      implemented as an <code class="literal">INFORMATION_SCHEMA</code> plugin;
      you can verify that it is supported by checking the output of
      <a class="link" href="sql-syntax.html#show-plugins" title="13.7.5.25 SHOW PLUGINS Syntax"><code class="literal">SHOW PLUGINS</code></a>. If
      <code class="literal">ndb_transid_mysql_connection_map</code> support is
      enabled, the output from this statement includes a plugin having
      this name, of type <code class="literal">INFORMATION SCHEMA</code>, and
      having status <code class="literal">ACTIVE</code>, as shown here (using
      emphasized text):
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SHOW PLUGINS;</code></strong>
+----------------------------------+--------+--------------------+---------+---------+
| Name                             | Status | Type               | Library | License |
+----------------------------------+--------+--------------------+---------+---------+
| binlog                           | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| mysql_native_password            | ACTIVE | AUTHENTICATION     | NULL    | GPL     |
| CSV                              | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| MEMORY                           | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| MRG_MYISAM                       | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| MyISAM                           | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| PERFORMANCE_SCHEMA               | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| BLACKHOLE                        | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| ARCHIVE                          | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| ndbcluster                       | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| ndbinfo                          | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
<span class="emphasis"><em>| ndb_transid_mysql_connection_map | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |</em></span>
| InnoDB                           | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
| INNODB_TRX                       | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_LOCKS                     | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_LOCK_WAITS                | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMP                       | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMP_RESET                 | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMPMEM                    | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |
| INNODB_CMPMEM_RESET              | ACTIVE | INFORMATION SCHEMA | NULL    | GPL     |
| partition                        | ACTIVE | STORAGE ENGINE     | NULL    | GPL     |
+----------------------------------+--------+--------------------+---------+---------+
22 rows in set (0.00 sec)
</pre><p>
      The plugin is enabled by default. You can disable it (or force the
      server not to run unless the plugin starts) by starting the server
      with the
      <a class="link" href="mysql-cluster.html#option_mysqld_ndb-transid-mysql-connection-map"><code class="option">--ndb-transid-mysql-connection-map</code></a>
      option. If the plugin is disabled, the status is shown by
      <a class="link" href="sql-syntax.html#show-plugins" title="13.7.5.25 SHOW PLUGINS Syntax"><code class="literal">SHOW PLUGINS</code></a> as
      <code class="literal">DISABLED</code>. The plugin cannot be enabled or
      disabled at runtime.
    </p><p>
      Although the names of this table and its columns are displayed
      using lowercase, you can use uppercase or lowercase when referring
      to them in SQL statements.
    </p><p>
      For this table to be created, the MySQL Server must be a binary
      supplied with the NDB Cluster distribution, or one built from the
      NDB Cluster sources with <a class="link" href="mysql-cluster.html" title="Chapter 21 MySQL NDB Cluster 7.5 and NDB Cluster 7.6"><code class="literal">NDB</code></a> storage
      engine support enabled. It is not available in the standard MySQL
      5.7 Server.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="optimizer-trace-table"></a>24.13 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592726896"></a><p>
      The <a class="link" href="information-schema.html#optimizer-trace-table" title="24.13 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table"><code class="literal">OPTIMIZER_TRACE</code></a> table provides
      information produced by the optimizer tracing capability. To
      enable tracking, use the
      <a class="link" href="server-administration.html#sysvar_optimizer_trace"><code class="literal">optimizer_trace</code></a> system variable.
      For details, see
      <a class="ulink" href="http://dev.mysql.com/doc/internals/en/optimizer-tracing.html" target="_top">MySQL
      Internals: Tracing the Optimizer</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="parameters-table"></a>24.14 The INFORMATION_SCHEMA PARAMETERS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592720144"></a><p>
      The <a class="link" href="information-schema.html#parameters-table" title="24.14 The INFORMATION_SCHEMA PARAMETERS Table"><code class="literal">PARAMETERS</code></a> table provides
      information about stored procedure and function parameters, and
      about return values for stored functions. Parameter information is
      similar to the contents of the <code class="literal">param_list</code>
      column in the <code class="literal">mysql.proc</code> table.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA PARAMETERS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><code class="literal">mysql.proc</code> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">SPECIFIC_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">SPECIFIC_SCHEMA</code></td>
          <td><code class="literal">db</code></td>
          <td>routine database</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPECIFIC_NAME</code></td>
          <td><code class="literal">name</code></td>
          <td>routine name</td>
        </tr><tr>
          <td scope="row"><code class="literal">ORDINAL_POSITION</code></td>
          <td></td>
          <td>1, 2, 3, ... for parameters, 0 for function <code class="literal">RETURNS</code>
            clause</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARAMETER_MODE</code></td>
          <td></td>
          <td><code class="literal">IN</code>, <code class="literal">OUT</code>, <code class="literal">INOUT</code>
            (<code class="literal">NULL</code> for <code class="literal">RETURNS</code>)</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARAMETER_NAME</code></td>
          <td></td>
          <td>parameter name (<code class="literal">NULL</code> for <code class="literal">RETURNS</code>)</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_TYPE</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_MAXIMUM_LENGTH</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_OCTET_LENGTH</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMERIC_PRECISION</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMERIC_SCALE</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATETIME_PRECISION</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_NAME</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION_NAME</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">DTD_IDENTIFIER</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_TYPE</code></td>
          <td>type</td>
          <td>same as for <a class="link" href="information-schema.html#routines-table" title="24.20 The INFORMATION_SCHEMA ROUTINES Table"><code class="literal">ROUTINES</code></a> table</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          For successive parameters of a stored procedure or function,
          the <code class="literal">ORDINAL_POSITION</code> values are 1, 2, 3,
          and so forth. For a stored function, there is also a row that
          describes the data type for the <code class="literal">RETURNS</code>
          clause. The return value is not a true parameter, so the row
          that describes it has these unique characteristics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              The <code class="literal">ORDINAL_POSITION</code> value is 0.
            </p></li><li class="listitem"><p>
              The <code class="literal">PARAMETER_NAME</code> and
              <code class="literal">PARAMETER_MODE</code> values are
              <code class="literal">NULL</code> because the return value has no
              name and the mode does not apply.
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="partitions-table"></a>24.15 The INFORMATION_SCHEMA PARTITIONS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592620256"></a><p>
      The <a class="link" href="information-schema.html#partitions-table" title="24.15 The INFORMATION_SCHEMA PARTITIONS Table"><code class="literal">PARTITIONS</code></a> table provides
      information about table partitions. See
      <a class="xref" href="partitioning.html" title="Chapter 22 Partitioning">Chapter 22, <i>Partitioning</i></a>, for more information about
      partitioning tables.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA PARTITIONS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARTITION_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SUBPARTITION_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARTITION_ORDINAL_POSITION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SUBPARTITION_ORDINAL_POSITION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARTITION_METHOD</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SUBPARTITION_METHOD</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARTITION_EXPRESSION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">SUBPARTITION_EXPRESSION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARTITION_DESCRIPTION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_ROWS</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">AVG_ROW_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAX_DATA_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_LENGTH</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_FREE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATE_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">UPDATE_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHECK_TIME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHECKSUM</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PARTITION_COMMENT</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">NODEGROUP</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLESPACE_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <a class="link" href="information-schema.html#partitions-table" title="24.15 The INFORMATION_SCHEMA PARTITIONS Table"><code class="literal">PARTITIONS</code></a> table is a
          nonstandard table.
        </p><p>
          Each record in this table corresponds to an individual
          partition or subpartition of a partitioned table.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_CATALOG</code>: This column is always
          <code class="literal">def</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_SCHEMA</code>: This column contains the name
          of the database to which the table belongs.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_NAME</code>: This column contains the name
          of the table containing the partition.
        </p></li><li class="listitem"><p>
          <code class="literal">PARTITION_NAME</code>: The name of the partition.
        </p></li><li class="listitem"><p>
          <code class="literal">SUBPARTITION_NAME</code>: If the
          <a class="link" href="information-schema.html#partitions-table" title="24.15 The INFORMATION_SCHEMA PARTITIONS Table"><code class="literal">PARTITIONS</code></a> table record
          represents a subpartition, then this column contains the name
          of subpartition; otherwise it is <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">PARTITION_ORDINAL_POSITION</code>: All partitions
          are indexed in the same order as they are defined, with
          <code class="literal">1</code> being the number assigned to the first
          partition. The indexing can change as partitions are added,
          dropped, and reorganized; the number shown is this column
          reflects the current order, taking into account any indexing
          changes.
        </p></li><li class="listitem"><p>
          <code class="literal">SUBPARTITION_ORDINAL_POSITION</code>:
          Subpartitions within a given partition are also indexed and
          reindexed in the same manner as partitions are indexed within
          a table.
        </p></li><li class="listitem"><p>
          <code class="literal">PARTITION_METHOD</code>: One of the values
          <code class="literal">RANGE</code>, <code class="literal">LIST</code>,
          <code class="literal">HASH</code>, <code class="literal">LINEAR HASH</code>,
          <code class="literal">KEY</code>, or <code class="literal">LINEAR KEY</code>; that
          is, one of the available partitioning types as discussed in
          <a class="xref" href="partitioning.html#partitioning-types" title="22.2 Partitioning Types">Section 22.2, “Partitioning Types”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">SUBPARTITION_METHOD</code>: One of the values
          <code class="literal">HASH</code>, <code class="literal">LINEAR HASH</code>,
          <code class="literal">KEY</code>, or <code class="literal">LINEAR KEY</code>; that
          is, one of the available subpartitioning types as discussed in
          <a class="xref" href="partitioning.html#partitioning-subpartitions" title="22.2.6 Subpartitioning">Section 22.2.6, “Subpartitioning”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">PARTITION_EXPRESSION</code>: This is the
          expression for the partitioning function used in the
          <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> or
          <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> statement that
          created the table's current partitioning scheme.
        </p><p>
          For example, consider a partitioned table created in the
          <code class="literal">test</code> database using this statement:
        </p><pre data-lang="sql" class="programlisting">
CREATE TABLE tp (
    c1 INT,
    c2 INT,
    c3 VARCHAR(25)
)
PARTITION BY HASH(c1 + c2)
PARTITIONS 4;
</pre><p>
          The <code class="literal">PARTITION_EXPRESSION</code> column in a
          PARTITIONS table record for a partition from this table
          displays <code class="literal">c1 + c2</code>, as shown here:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT DISTINCT PARTITION_EXPRESSION</code></strong>
     &gt;     <strong class="userinput"><code>FROM INFORMATION_SCHEMA.PARTITIONS</code></strong>
     &gt;     <strong class="userinput"><code>WHERE TABLE_NAME='tp' AND TABLE_SCHEMA='test';</code></strong>
+----------------------+
| PARTITION_EXPRESSION |
+----------------------+
| c1 + c2              |
+----------------------+
1 row in set (0.09 sec)
</pre></li><li class="listitem"><p>
          <code class="literal">SUBPARTITION_EXPRESSION</code>: This works in the
          same fashion for the subpartitioning expression that defines
          the subpartitioning for a table as
          <code class="literal">PARTITION_EXPRESSION</code> does for the
          partitioning expression used to define a table's partitioning.
        </p><p>
          If the table has no subpartitions, then this column is
          <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">PARTITION_DESCRIPTION</code>: This column is used
          for RANGE and LIST partitions. For a <code class="literal">RANGE</code>
          partition, it contains the value set in the partition's
          <code class="literal">VALUES LESS THAN</code> clause, which can be
          either an integer or <code class="literal">MAXVALUE</code>. For a
          <code class="literal">LIST</code> partition, this column contains the
          values defined in the partition's <code class="literal">VALUES IN</code>
          clause, which is a comma-separated list of integer values.
        </p><p>
          For partitions whose <code class="literal">PARTITION_METHOD</code> is
          other than <code class="literal">RANGE</code> or
          <code class="literal">LIST</code>, this column is always
          <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_ROWS</code>: The number of table rows in the
          partition.
        </p><p>
          For partitioned <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables,
          the row count given in the <code class="literal">TABLE_ROWS</code>
          column is only an estimated value used in SQL optimization,
          and may not always be exact.
        </p></li><li class="listitem"><p>
          <code class="literal">AVG_ROW_LENGTH</code>: The average length of the
          rows stored in this partition or subpartition, in bytes.
        </p><p>
          This is the same as <code class="literal">DATA_LENGTH</code> divided by
          <code class="literal">TABLE_ROWS</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">DATA_LENGTH</code>: The total length of all rows
          stored in this partition or subpartition, in bytes—that
          is, the total number of bytes stored in the partition or
          subpartition.
        </p></li><li class="listitem"><p>
          <code class="literal">MAX_DATA_LENGTH</code>: The maximum number of
          bytes that can be stored in this partition or subpartition.
        </p></li><li class="listitem"><p>
          <code class="literal">INDEX_LENGTH</code>: The length of the index file
          for this partition or subpartition, in bytes.
        </p></li><li class="listitem"><p>
          <code class="literal">DATA_FREE</code>: The number of bytes allocated to
          the partition or subpartition but not used.
        </p></li><li class="listitem"><p>
          <code class="literal">CREATE_TIME</code>: The time of the partition's or
          subpartition's creation.
        </p></li><li class="listitem"><p>
          <code class="literal">UPDATE_TIME</code>: The time that the partition or
          subpartition was last modified.
        </p></li><li class="listitem"><p>
          <code class="literal">CHECK_TIME</code>: The last time that the table to
          which this partition or subpartition belongs was checked.
        </p><p>
          For partitioned <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables,
          this column is always <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">CHECKSUM</code>: The checksum value, if any;
          otherwise, this column is <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">PARTITION_COMMENT</code>: This column contains the
          text of any comment made for the partition.
        </p><p>
          In MySQL 5.7, the maximum length for a partition
          comment is defined as 1024 characters, and the display width
          of the <code class="literal">PARTITION_COMMENT</code> column is also
          1024, characters to match this limit (Bug #11748924, Bug
          #37728).
        </p><p>
          The default value for this column is an empty string.
        </p></li><li class="listitem"><p>
          <code class="literal">NODEGROUP</code>: This is the nodegroup to which
          the partition belongs. This is relevant only to NDB Cluster
          tables; otherwise the value of this column is always
          <code class="literal">0</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLESPACE_NAME</code>: This column contains the
          name of the tablespace to which the partition belongs. The
          value of this column is always <code class="literal">DEFAULT</code>.
        </p></li><li class="listitem"><p>
          A nonpartitioned table has one record in
          <a class="link" href="information-schema.html#partitions-table" title="24.15 The INFORMATION_SCHEMA PARTITIONS Table"><code class="literal">INFORMATION_SCHEMA.PARTITIONS</code></a>;
          however, the values of the <code class="literal">PARTITION_NAME</code>,
          <code class="literal">SUBPARTITION_NAME</code>,
          <code class="literal">PARTITION_ORDINAL_POSITION</code>,
          <code class="literal">SUBPARTITION_ORDINAL_POSITION</code>,
          <code class="literal">PARTITION_METHOD</code>,
          <code class="literal">SUBPARTITION_METHOD</code>,
          <code class="literal">PARTITION_EXPRESSION</code>,
          <code class="literal">SUBPARTITION_EXPRESSION</code>, and
          <code class="literal">PARTITION_DESCRIPTION</code> columns are all
          <code class="literal">NULL</code>. (The
          <code class="literal">PARTITION_COMMENT</code> column in this case is
          blank.)
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="plugins-table"></a>24.16 The INFORMATION_SCHEMA PLUGINS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592421440"></a><p>
      The <a class="link" href="information-schema.html#plugins-table" title="24.16 The INFORMATION_SCHEMA PLUGINS Table"><code class="literal">PLUGINS</code></a> table provides
      information about server plugins.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA PLUGINS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">PLUGIN_NAME</code></td>
          <td><code class="literal">Name</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_VERSION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_STATUS</code></td>
          <td><code class="literal">Status</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_TYPE</code></td>
          <td><code class="literal">Type</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_TYPE_VERSION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_LIBRARY</code></td>
          <td><code class="literal">Library</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_LIBRARY_VERSION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_AUTHOR</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_DESCRIPTION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PLUGIN_LICENSE</code></td>
          <td><code class="literal">License</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOAD_OPTION</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <a class="link" href="information-schema.html#plugins-table" title="24.16 The INFORMATION_SCHEMA PLUGINS Table"><code class="literal">PLUGINS</code></a> table is a
          nonstandard table.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_NAME</code> is the name used to refer to
          the plugin in statements such as <a class="link" href="sql-syntax.html#install-plugin" title="13.7.3.3 INSTALL PLUGIN Syntax"><code class="literal">INSTALL
          PLUGIN</code></a> and <a class="link" href="sql-syntax.html#uninstall-plugin" title="13.7.3.4 UNINSTALL PLUGIN Syntax"><code class="literal">UNINSTALL
          PLUGIN</code></a>.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_VERSION</code> is the version from the
          plugin's general type descriptor.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_STATUS</code> indicates the plugin status,
          one of <code class="literal">ACTIVE</code>, <code class="literal">INACTIVE</code>,
          <code class="literal">DISABLED</code>, or <code class="literal">DELETED</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_TYPE</code> indicates the type of plugin,
          such as <code class="literal">STORAGE ENGINE</code>,
          <code class="literal">INFORMATION_SCHEMA</code>, or
          <code class="literal">AUTHENTICATION</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_TYPE_VERSION</code> is the version from the
          plugin's type-specific descriptor.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_LIBRARY</code> is the name of the plugin
          shared library file. This is the name used to refer to the
          plugin file in statements such as <a class="link" href="sql-syntax.html#install-plugin" title="13.7.3.3 INSTALL PLUGIN Syntax"><code class="literal">INSTALL
          PLUGIN</code></a> and <a class="link" href="sql-syntax.html#uninstall-plugin" title="13.7.3.4 UNINSTALL PLUGIN Syntax"><code class="literal">UNINSTALL
          PLUGIN</code></a>. This file is located in the directory named
          by the <a class="link" href="server-administration.html#sysvar_plugin_dir"><code class="literal">plugin_dir</code></a> system
          variable. If the library name is <code class="literal">NULL</code>, the
          plugin is compiled in and cannot be uninstalled with
          <a class="link" href="sql-syntax.html#uninstall-plugin" title="13.7.3.4 UNINSTALL PLUGIN Syntax"><code class="literal">UNINSTALL PLUGIN</code></a>.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_LIBRARY_VERSION</code> indicates the plugin
          API interface version.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_AUTHOR</code> names the plugin author.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_DESCRIPTION</code> provides a short
          description of the plugin.
        </p></li><li class="listitem"><p>
          <code class="literal">PLUGIN_LICENSE</code> indicates how the plugin is
          licensed; for example, <code class="literal">GPL</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">LOAD_OPTION</code> indicates how the plugin was
          loaded. The value is <code class="literal">OFF</code>,
          <code class="literal">ON</code>, <code class="literal">FORCE</code>, or
          <code class="literal">FORCE_PLUS_PERMANENT</code>. See
          <a class="xref" href="server-administration.html#server-plugin-loading" title="5.5.1 Installing and Uninstalling Plugins">Section 5.5.1, “Installing and Uninstalling Plugins”</a>.
</p></li></ul>
</div>
<p>
      For plugins installed with <a class="link" href="sql-syntax.html#install-plugin" title="13.7.3.3 INSTALL PLUGIN Syntax"><code class="literal">INSTALL
      PLUGIN</code></a>, the <code class="literal">PLUGIN_NAME</code> and
      <code class="literal">PLUGIN_LIBRARY</code> values are also registered in
      the <code class="literal">mysql.plugin</code> table.
    </p><p>
      These statements are equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT
  PLUGIN_NAME, PLUGIN_STATUS, PLUGIN_TYPE,
  PLUGIN_LIBRARY, PLUGIN_LICENSE
FROM INFORMATION_SCHEMA.PLUGINS;

SHOW PLUGINS;
</pre><p>
      For information about plugin data structures that form the basis
      of the information in the <a class="link" href="information-schema.html#plugins-table" title="24.16 The INFORMATION_SCHEMA PLUGINS Table"><code class="literal">PLUGINS</code></a>
      table, see <a class="xref" href="extending-mysql.html#plugin-api" title="28.2 The MySQL Plugin API">Section 28.2, “The MySQL Plugin API”</a>.
    </p><p>
      Plugin information is also available using the
      <a class="link" href="sql-syntax.html#show-plugins" title="13.7.5.25 SHOW PLUGINS Syntax"><code class="literal">SHOW PLUGINS</code></a> statement. See
      <a class="xref" href="sql-syntax.html#show-plugins" title="13.7.5.25 SHOW PLUGINS Syntax">Section 13.7.5.25, “SHOW PLUGINS Syntax”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="processlist-table"></a>24.17 The INFORMATION_SCHEMA PROCESSLIST Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592317904"></a><a class="indexterm" name="idm140710592316432"></a><p>
      The <a class="link" href="information-schema.html#processlist-table" title="24.17 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">PROCESSLIST</code></a> table provides
      information about which threads are running.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA PROCESSLIST table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">ID</code></td>
          <td><code class="literal">Id</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">USER</code></td>
          <td><code class="literal">User</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">HOST</code></td>
          <td><code class="literal">Host</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DB</code></td>
          <td><code class="literal">db</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMMAND</code></td>
          <td><code class="literal">Command</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TIME</code></td>
          <td><code class="literal">Time</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">STATE</code></td>
          <td><code class="literal">State</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INFO</code></td>
          <td><code class="literal">Info</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      For an extensive description of the table columns, see
      <a class="xref" href="sql-syntax.html#show-processlist" title="13.7.5.29 SHOW PROCESSLIST Syntax">Section 13.7.5.29, “SHOW PROCESSLIST Syntax”</a>.
    </p><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <a class="link" href="information-schema.html#processlist-table" title="24.17 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">PROCESSLIST</code></a> table is a
          nonstandard table.
        </p></li><li class="listitem"><p>
          Like the output from the corresponding
          <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statement, the
          <a class="link" href="information-schema.html#processlist-table" title="24.17 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">PROCESSLIST</code></a> table will only show
          information about your own threads, unless you have the
          <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a> privilege, in which
          case you will see information about other threads, too. As an
          anonymous user, you cannot see any rows at all.
        </p></li><li class="listitem"><p>
          If an SQL statement refers to
          <a class="link" href="information-schema.html#processlist-table" title="24.17 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">INFORMATION_SCHEMA.PROCESSLIST</code></a>,
          MySQL populates the entire table once, when statement
          execution begins, so there is read consistency during the
          statement. There is no read consistency for a multi-statement
          transaction, though.
        </p></li><li class="listitem"><p>
          Process information is also available from the
          <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">performance_schema.threads</code></a> table.
          However, access to <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a> does
          not require a mutex and has minimal impact on server
          performance.
          <a class="link" href="information-schema.html#processlist-table" title="24.17 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">INFORMATION_SCHEMA.PROCESSLIST</code></a>
          and <a class="link" href="sql-syntax.html#show-processlist" title="13.7.5.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW PROCESSLIST</code></a> have
          negative performance consequences because they require a
          mutex. <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a> also shows
          information about background threads, which
          <a class="link" href="information-schema.html#processlist-table" title="24.17 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">INFORMATION_SCHEMA.PROCESSLIST</code></a>
          and <a class="link" href="sql-syntax.html#show-processlist" title="13.7.5.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW PROCESSLIST</code></a> do not.
          This means that <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a> can be
          used to monitor activity the other thread information sources
          cannot.
</p></li></ul>
</div>
<p>
      The following statements are equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST

SHOW FULL PROCESSLIST
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="profiling-table"></a>24.18 The INFORMATION_SCHEMA PROFILING Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592245872"></a><p>
      The <a class="link" href="information-schema.html#profiling-table" title="24.18 The INFORMATION_SCHEMA PROFILING Table"><code class="literal">PROFILING</code></a> table provides
      statement profiling information. Its contents correspond to the
      information produced by the <a class="link" href="sql-syntax.html#show-profiles" title="13.7.5.31 SHOW PROFILES Syntax"><code class="literal">SHOW
      PROFILES</code></a> and <a class="link" href="sql-syntax.html#show-profile" title="13.7.5.30 SHOW PROFILE Syntax"><code class="literal">SHOW PROFILE</code></a>
      statements (see <a class="xref" href="sql-syntax.html#show-profiles" title="13.7.5.31 SHOW PROFILES Syntax">Section 13.7.5.31, “SHOW PROFILES Syntax”</a>). The table is
      empty unless the <a class="link" href="server-administration.html#sysvar_profiling"><code class="literal">profiling</code></a>
      session variable is set to 1.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        This table is deprecated as of MySQL 5.7.2 and will be removed
        in a future MySQL release. Use the Performance Schema instead;
        see <a class="xref" href="performance-schema.html" title="Chapter 25 MySQL Performance Schema">Chapter 25, <i>MySQL Performance Schema</i></a>.
</p>
</div>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA PROFILING table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">QUERY_ID</code></td>
          <td><code class="literal">Query_ID</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SEQ</code></td>
          <td><code class="literal"></code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">STATE</code></td>
          <td><code class="literal">Status</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DURATION</code></td>
          <td><code class="literal">Duration</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CPU_USER</code></td>
          <td><code class="literal">CPU_user</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CPU_SYSTEM</code></td>
          <td><code class="literal">CPU_system</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CONTEXT_VOLUNTARY</code></td>
          <td><code class="literal">Context_voluntary</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CONTEXT_INVOLUNTARY</code></td>
          <td><code class="literal">Context_involuntary</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">BLOCK_OPS_IN</code></td>
          <td><code class="literal">Block_ops_in</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">BLOCK_OPS_OUT</code></td>
          <td><code class="literal">Block_ops_out</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">MESSAGES_SENT</code></td>
          <td><code class="literal">Messages_sent</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">MESSAGES_RECEIVED</code></td>
          <td><code class="literal">Messages_received</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_FAULTS_MAJOR</code></td>
          <td><code class="literal">Page_faults_major</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_FAULTS_MINOR</code></td>
          <td><code class="literal">Page_faults_minor</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SWAPS</code></td>
          <td><code class="literal">Swaps</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SOURCE_FUNCTION</code></td>
          <td><code class="literal">Source_function</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SOURCE_FILE</code></td>
          <td><code class="literal">Source_file</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SOURCE_LINE</code></td>
          <td><code class="literal">Source_line</code></td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">QUERY_ID</code> is a numeric statement identifier.
        </p></li><li class="listitem"><p>
          <code class="literal">SEQ</code> is a sequence number indicating the
          display order for rows with the same
          <code class="literal">QUERY_ID</code> value.
        </p></li><li class="listitem"><p>
          <code class="literal">STATE</code> is the profiling state to which the
          row measurements apply.
        </p></li><li class="listitem"><p>
          <code class="literal">DURATION</code> indicates how long statement
          execution remained in the given state, in seconds.
        </p></li><li class="listitem"><p>
          <code class="literal">CPU_USER</code> and <code class="literal">CPU_SYSTEM</code>
          indicate user and system CPU use, in seconds.
        </p></li><li class="listitem"><p>
          <code class="literal">CONTEXT_VOLUNTARY</code> and
          <code class="literal">CONTEXT_INVOLUNTARY</code> indicate how many
          voluntary and involuntary context switches occurred.
        </p></li><li class="listitem"><p>
          <code class="literal">BLOCK_OPS_IN</code> and
          <code class="literal">BLOCK_OPS_OUT</code> indicate the number of block
          input and output operations.
        </p></li><li class="listitem"><p>
          <code class="literal">MESSAGES_SENT</code> and
          <code class="literal">MESSAGES_RECEIVED</code> indicate the number of
          communication messages sent and received.
        </p></li><li class="listitem"><p>
          <code class="literal">PAGE_FAULTS_MAJOR</code> and
          <code class="literal">PAGE_FAULTS_MINOR</code> indicate the number of
          major and minor page faults.
        </p></li><li class="listitem"><p>
          <code class="literal">SWAPS</code> indicates how many swaps occurred.
        </p></li><li class="listitem"><p>
          <code class="literal">SOURCE_FUNCTION</code>,
          <code class="literal">SOURCE_FILE</code>, and
          <code class="literal">SOURCE_LINE</code> provide information indicating
          where in the source code the profiled state executes.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="referential-constraints-table"></a>24.19 The INFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592130912"></a><p>
      The <a class="link" href="information-schema.html#referential-constraints-table" title="24.19 The INFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS Table"><code class="literal">REFERENTIAL_CONSTRAINTS</code></a> table
      provides information about foreign keys.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA REFERENTIAL_CONSTRAINTS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row">CONSTRAINT_CATALOG</td>
          <td></td>
          <td>def</td>
        </tr><tr>
          <td scope="row">CONSTRAINT_SCHEMA</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">CONSTRAINT_NAME</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">UNIQUE_CONSTRAINT_CATALOG</td>
          <td></td>
          <td>def</td>
        </tr><tr>
          <td scope="row">UNIQUE_CONSTRAINT_SCHEMA</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">UNIQUE_CONSTRAINT_NAME</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">MATCH_OPTION</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">UPDATE_RULE</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">DELETE_RULE</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">TABLE_NAME</td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row">REFERENCED_TABLE_NAME</td>
          <td></td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">TABLE_NAME</code> has the same value as
          <code class="literal">TABLE_NAME</code> in
          <a class="link" href="information-schema.html#table-constraints-table" title="24.26 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table"><code class="literal">INFORMATION_SCHEMA.TABLE_CONSTRAINTS</code></a>.
        </p></li><li class="listitem"><p>
          <code class="literal">CONSTRAINT_SCHEMA</code> and
          <code class="literal">CONSTRAINT_NAME</code> identify the foreign key.
        </p></li><li class="listitem"><p>
          <code class="literal">UNIQUE_CONSTRAINT_SCHEMA</code>,
          <code class="literal">UNIQUE_CONSTRAINT_NAME</code>, and
          <code class="literal">REFERENCED_TABLE_NAME</code> identify the
          referenced key.
        </p></li><li class="listitem"><p>
          The only valid value at this time for
          <code class="literal">MATCH_OPTION</code> is <code class="literal">NONE</code>.
        </p></li><li class="listitem"><p>
          The possible values for <code class="literal">UPDATE_RULE</code> or
          <code class="literal">DELETE_RULE</code> are <code class="literal">CASCADE</code>,
          <code class="literal">SET NULL</code>, <code class="literal">SET DEFAULT</code>,
          <code class="literal">RESTRICT</code>, <code class="literal">NO ACTION</code>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="routines-table"></a>24.20 The INFORMATION_SCHEMA ROUTINES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710592065968"></a><p>
      The <a class="link" href="information-schema.html#routines-table" title="24.20 The INFORMATION_SCHEMA ROUTINES Table"><code class="literal">ROUTINES</code></a> table provides
      information about stored routines (both procedures and functions).
      The <a class="link" href="information-schema.html#routines-table" title="24.20 The INFORMATION_SCHEMA ROUTINES Table"><code class="literal">ROUTINES</code></a> table does not include
      user-defined functions (UDFs).
    </p><p>
      The column named <span class="quote">“<span class="quote"><code class="literal">mysql.proc</code> Name</span>”</span>
      indicates the <code class="literal">mysql.proc</code> table column that
      corresponds to the
      <a class="link" href="information-schema.html#routines-table" title="24.20 The INFORMATION_SCHEMA ROUTINES Table"><code class="literal">INFORMATION_SCHEMA.ROUTINES</code></a> table
      column, if any.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA ROUTINES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><code class="literal">mysql.proc</code> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">SPECIFIC_NAME</code></td>
          <td><code class="literal">specific_name</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_SCHEMA</code></td>
          <td><code class="literal">db</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_NAME</code></td>
          <td><code class="literal">name</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_TYPE</code></td>
          <td><code class="literal">type</code></td>
          <td><code class="literal">{PROCEDURE|FUNCTION}</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_TYPE</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_MAXIMUM_LENGTH</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_OCTET_LENGTH</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMERIC_PRECISION</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMERIC_SCALE</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATETIME_PRECISION</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_NAME</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION_NAME</code></td>
          <td></td>
          <td>same as for <a class="link" href="information-schema.html#columns-table" title="24.4 The INFORMATION_SCHEMA COLUMNS Table"><code class="literal">COLUMNS</code></a> table</td>
        </tr><tr>
          <td scope="row"><code class="literal">DTD_IDENTIFIER</code></td>
          <td></td>
          <td>data type descriptor</td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_BODY</code></td>
          <td></td>
          <td><code class="literal">SQL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_DEFINITION</code></td>
          <td><code class="literal">body_utf8</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">EXTERNAL_NAME</code></td>
          <td></td>
          <td><code class="literal">NULL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">EXTERNAL_LANGUAGE</code></td>
          <td><code class="literal">language</code></td>
          <td><code class="literal">NULL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">PARAMETER_STYLE</code></td>
          <td></td>
          <td><code class="literal">SQL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_DETERMINISTIC</code></td>
          <td><code class="literal">is_deterministic</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SQL_DATA_ACCESS</code></td>
          <td><code class="literal">sql_data_access</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SQL_PATH</code></td>
          <td></td>
          <td><code class="literal">NULL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">SECURITY_TYPE</code></td>
          <td><code class="literal">security_type</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATED</code></td>
          <td><code class="literal">created</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">LAST_ALTERED</code></td>
          <td><code class="literal">modified</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SQL_MODE</code></td>
          <td><code class="literal">sql_mode</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ROUTINE_COMMENT</code></td>
          <td><code class="literal">comment</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DEFINER</code></td>
          <td><code class="literal">definer</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_CLIENT</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION_CONNECTION</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATABASE_COLLATION</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          MySQL calculates <code class="literal">EXTERNAL_LANGUAGE</code> thus:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              If <code class="literal">mysql.proc.language='SQL'</code>,
              <code class="literal">EXTERNAL_LANGUAGE</code> is
              <code class="literal">NULL</code>
            </p></li><li class="listitem"><p>
              Otherwise, <code class="literal">EXTERNAL_LANGUAGE</code> is what is
              in <code class="literal">mysql.proc.language</code>. However, we do
              not have external languages yet, so it is always
              <code class="literal">NULL</code>.
</p></li></ul>
</div>
</li><li class="listitem"><p>
          <code class="literal">CREATED</code>: The date and time when the routine
          was created. This is a
          <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a> value.
        </p></li><li class="listitem"><p>
          <code class="literal">LAST_ALTERED</code>: The date and time when the
          routine was last modified. This is a
          <a class="link" href="data-types.html#datetime" title="11.3.1 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a> value. If the routine
          has not been modified since its creation, this column holds
          the same value as the <code class="literal">CREATED</code> column.
        </p></li><li class="listitem"><p>
          <code class="literal">SQL_MODE</code>: The SQL mode in effect when the
          routine was created or altered, and under which the routine
          executes. For the permitted values, see
          <a class="xref" href="server-administration.html#sql-mode" title="5.1.10 Server SQL Modes">Section 5.1.10, “Server SQL Modes”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">CHARACTER_SET_CLIENT</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_character_set_client"><code class="literal">character_set_client</code></a>
          system variable when the routine was created.
        </p></li><li class="listitem"><p>
          <code class="literal">COLLATION_CONNECTION</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_collation_connection"><code class="literal">collation_connection</code></a>
          system variable when the routine was created.
        </p></li><li class="listitem"><p>
          <code class="literal">DATABASE_COLLATION</code>: The collation of the
          database with which the routine is associated.
        </p></li><li class="listitem"><p>
          The <code class="literal">DATA_TYPE</code>,
          <code class="literal">CHARACTER_MAXIMUM_LENGTH</code>,
          <code class="literal">CHARACTER_OCTET_LENGTH</code>,
          <code class="literal">NUMERIC_PRECISION</code>,
          <code class="literal">NUMERIC_SCALE</code>,
          <code class="literal">DATETIME_PRECISION</code>,
          <code class="literal">CHARACTER_SET_NAME</code>, and
          <code class="literal">COLLATION_NAME</code> columns provide information
          about the data type for the <code class="literal">RETURNS</code> clause
          of stored functions. If a stored routine is a stored
          procedure, these columns all are <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          Information about stored function <code class="literal">RETURNS</code>
          data types is also available in the
          <a class="link" href="information-schema.html#parameters-table" title="24.14 The INFORMATION_SCHEMA PARAMETERS Table"><code class="literal">PARAMETERS</code></a> table. The return
          value data type row for a function can be identified as the
          row that has an <code class="literal">ORDINAL_POSITION</code> value of
          0.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="schemata-table"></a>24.21 The INFORMATION_SCHEMA SCHEMATA Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591882032"></a><p>
      A schema is a database, so the
      <a class="link" href="information-schema.html#schemata-table" title="24.21 The INFORMATION_SCHEMA SCHEMATA Table"><code class="literal">SCHEMATA</code></a> table provides information
      about databases.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA SCHEMATA table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">CATALOG_NAME</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">SCHEMA_NAME</code></td>
          <td>Database</td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DEFAULT_CHARACTER_SET_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DEFAULT_COLLATION_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SQL_PATH</code></td>
          <td></td>
          <td><code class="literal">NULL</code></td>
</tr></tbody></table>
</div>
<p>
      The following statements are equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT SCHEMA_NAME AS `Database`
  FROM INFORMATION_SCHEMA.SCHEMATA
  [WHERE SCHEMA_NAME LIKE '<em class="replaceable"><code>wild</code></em>']

SHOW DATABASES
  [LIKE '<em class="replaceable"><code>wild</code></em>']
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="schema-privileges-table"></a>24.22 The INFORMATION_SCHEMA SCHEMA_PRIVILEGES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591847920"></a><p>
      The <a class="link" href="information-schema.html#schema-privileges-table" title="24.22 The INFORMATION_SCHEMA SCHEMA_PRIVILEGES Table"><code class="literal">SCHEMA_PRIVILEGES</code></a> table provides
      information about schema (database) privileges. This information
      comes from the <code class="literal">mysql.db</code> grant table.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA SCHEMA_PRIVILEGES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">GRANTEE</code></td>
          <td></td>
          <td><code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
            value, MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code>, MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PRIVILEGE_TYPE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_GRANTABLE</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This is a nonstandard table. It takes its values from the
          <code class="literal">mysql.db</code> table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="statistics-table"></a>24.23 The INFORMATION_SCHEMA STATISTICS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591810800"></a><p>
      The <a class="link" href="information-schema.html#statistics-table" title="24.23 The INFORMATION_SCHEMA STATISTICS Table"><code class="literal">STATISTICS</code></a> table provides
      information about table indexes.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA STATISTICS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td>= Database</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td><code class="literal">Table</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">NON_UNIQUE</code></td>
          <td><code class="literal">Non_unique</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_SCHEMA</code></td>
          <td></td>
          <td>= Database</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_NAME</code></td>
          <td><code class="literal">Key_name</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SEQ_IN_INDEX</code></td>
          <td><code class="literal">Seq_in_index</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">COLUMN_NAME</code></td>
          <td><code class="literal">Column_name</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION</code></td>
          <td><code class="literal">Collation</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CARDINALITY</code></td>
          <td><code class="literal">Cardinality</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SUB_PART</code></td>
          <td><code class="literal">Sub_part</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PACKED</code></td>
          <td><code class="literal">Packed</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">NULLABLE</code></td>
          <td><code class="literal">Null</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_TYPE</code></td>
          <td><code class="literal">Index_type</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMMENT</code></td>
          <td><code class="literal">Comment</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_COMMENT</code></td>
          <td><code class="literal">Index_comment</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          There is no standard table for indexes. The preceding list is
          similar to what SQL Server 2000 returns for
          <code class="literal">sp_statistics</code>, except that we replaced the
          name <code class="literal">QUALIFIER</code> with
          <code class="literal">CATALOG</code> and we replaced the name
          <code class="literal">OWNER</code> with <code class="literal">SCHEMA</code>.
        </p><p>
          Clearly, the preceding table and the output from
          <a class="link" href="sql-syntax.html#show-index" title="13.7.5.22 SHOW INDEX Syntax"><code class="literal">SHOW INDEX</code></a> are derived from the
          same parent. So the correlation is already close.
</p></li></ul>
</div>
<p>
      The following statements are equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT * FROM INFORMATION_SCHEMA.STATISTICS
  WHERE table_name = '<em class="replaceable"><code>tbl_name</code></em>'
  AND table_schema = '<em class="replaceable"><code>db_name</code></em>'

SHOW INDEX
  FROM <em class="replaceable"><code>tbl_name</code></em>
  FROM <em class="replaceable"><code>db_name</code></em>
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="tables-table"></a>24.24 The INFORMATION_SCHEMA TABLES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591722928"></a><p>
      The <a class="link" href="information-schema.html#tables-table" title="24.24 The INFORMATION_SCHEMA TABLES Table"><code class="literal">TABLES</code></a> table provides information
      about tables in databases.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA TABLES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td><code class="literal">Table_</code>...</td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td><code class="literal">Table_</code>...</td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_TYPE</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ENGINE</code></td>
          <td><code class="literal">Engine</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">VERSION</code></td>
          <td><code class="literal">Version</code></td>
          <td>The version number of the table's <code class="filename">.frm</code> file, MySQL
            extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ROW_FORMAT</code></td>
          <td><code class="literal">Row_format</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_ROWS</code></td>
          <td><code class="literal">Rows</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">AVG_ROW_LENGTH</code></td>
          <td><code class="literal">Avg_row_length</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_LENGTH</code></td>
          <td><code class="literal">Data_length</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAX_DATA_LENGTH</code></td>
          <td><code class="literal">Max_data_length</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_LENGTH</code></td>
          <td><code class="literal">Index_length</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_FREE</code></td>
          <td><code class="literal">Data_free</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">AUTO_INCREMENT</code></td>
          <td><code class="literal">Auto_increment</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATE_TIME</code></td>
          <td><code class="literal">Create_time</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">UPDATE_TIME</code></td>
          <td><code class="literal">Update_time</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHECK_TIME</code></td>
          <td><code class="literal">Check_time</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_COLLATION</code></td>
          <td><code class="literal">Collation</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHECKSUM</code></td>
          <td><code class="literal">Checksum</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATE_OPTIONS</code></td>
          <td><code class="literal">Create_options</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_COMMENT</code></td>
          <td><code class="literal">Comment</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Refer to
          <a class="link" href="sql-syntax.html#show-table-status" title="13.7.5.36 SHOW TABLE STATUS Syntax"><code class="literal">SHOW TABLE
          STATUS</code></a> for field descriptions.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_SCHEMA</code> and
          <code class="literal">TABLE_NAME</code> are a single field in a
          <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> display, for example
          <code class="literal">Table_in_db1</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_TYPE</code> should be <code class="literal">BASE
          TABLE</code> or <code class="literal">VIEW</code>. The
          <a class="link" href="information-schema.html#tables-table" title="24.24 The INFORMATION_SCHEMA TABLES Table"><code class="literal">TABLES</code></a> table does not list
          <code class="literal">TEMPORARY</code> tables.
        </p></li><li class="listitem"><p>
          For partitioned tables, the <code class="literal">ENGINE</code> column
          shows the name of the storage engine used by all partitions.
          (Previously, this column showed <code class="literal">PARTITION</code>
          for such tables.)
        </p></li><li class="listitem"><p>
          The <code class="literal">TABLE_ROWS</code> column is
          <code class="literal">NULL</code> if the table is in the
          <code class="literal">INFORMATION_SCHEMA</code> database.
        </p><p>
          For <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables, the row count
          is only a rough estimate used in SQL optimization. (This is
          also true if the <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> table is
          partitioned.)
        </p></li><li class="listitem"><p>
          The <code class="literal">DATA_FREE</code> column shows the free space
          in bytes for <code class="literal">InnoDB</code> tables.
        </p></li><li class="listitem"><p>
          <code class="literal">UPDATE_TIME</code> displays a timestamp value for
          the last <a class="link" href="sql-syntax.html#update" title="13.2.11 UPDATE Syntax"><code class="literal">UPDATE</code></a>,
          <a class="link" href="sql-syntax.html#insert" title="13.2.5 INSERT Syntax"><code class="literal">INSERT</code></a>, or
          <a class="link" href="sql-syntax.html#delete" title="13.2.2 DELETE Syntax"><code class="literal">DELETE</code></a> performed on
          <code class="literal">InnoDB</code> tables that are not partitioned. For
          MVCC, the timestamp value reflects the
          <a class="link" href="sql-syntax.html#commit" title="13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Syntax"><code class="literal">COMMIT</code></a> time, which is
          considered the last update time. Timestamps are not persisted
          when the server is restarted or when the table is evicted from
          the <code class="literal">InnoDB</code> data dictionary cache.
        </p><p>
          The <code class="literal">UPDATE_TIME</code> column also shows this
          information for partitioned <code class="literal">InnoDB</code> tables.
        </p></li><li class="listitem"><p>
          For partitioned <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a> tables,
          the <code class="literal">CHECK_TIME</code> column is always
          <code class="literal">NULL</code>.
        </p></li><li class="listitem"><p>
          We have nothing for the table's default character set.
          <code class="literal">TABLE_COLLATION</code> is close, because collation
          names begin with a character set name.
        </p></li><li class="listitem"><p>
          The <code class="literal">CREATE_OPTIONS</code> column shows
          <code class="literal">partitioned</code> if the table is partitioned.
</p></li></ul>
</div>
<p>
      The following statements are equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT table_name FROM INFORMATION_SCHEMA.TABLES
  WHERE table_schema = '<em class="replaceable"><code>db_name</code></em>'
  [AND table_name LIKE '<em class="replaceable"><code>wild</code></em>']

SHOW TABLES
  FROM <em class="replaceable"><code>db_name</code></em>
  [LIKE '<em class="replaceable"><code>wild</code></em>']
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="tablespaces-table"></a>24.25 The INFORMATION_SCHEMA TABLESPACES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591579248"></a><p>
      The <a class="link" href="information-schema.html#tablespaces-table" title="24.25 The INFORMATION_SCHEMA TABLESPACES Table"><code class="literal">TABLESPACES</code></a> table provides
      information about active tablespaces.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA TABLESPACES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLESPACE_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">ENGINE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLESPACE_TYPE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOGFILE_GROUP_NAME</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">EXTENT_SIZE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">AUTOEXTEND_SIZE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAXIMUM_SIZE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">NODEGROUP_ID</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLESPACE_COMMENT</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
    </p><p>
      The <code class="literal">INFORMATION_SCHEMA.TABLESPACES</code> table does
      not provide information about <code class="literal">InnoDB</code>
      tablespaces. For <code class="literal">InnoDB</code> tablespace metadata,
      see <a class="link" href="information-schema.html#innodb-sys-tablespaces-table" title="24.31.23 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table"><code class="literal">INNODB_SYS_TABLESPACES</code></a> and
      <a class="link" href="information-schema.html#innodb-sys-datafiles-table" title="24.31.17 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table"><code class="literal">INNODB_SYS_DATAFILES</code></a>. As of MySQL
      5.7.8, the <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a>
      table also provides metadata for <code class="literal">InnoDB</code>
      tablespaces.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="table-constraints-table"></a>24.26 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591525344"></a><p>
      The <a class="link" href="information-schema.html#table-constraints-table" title="24.26 The INFORMATION_SCHEMA TABLE_CONSTRAINTS Table"><code class="literal">TABLE_CONSTRAINTS</code></a> table describes
      which tables have constraints.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA TABLE_CONSTRAINTS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">CONSTRAINT_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">CONSTRAINT_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CONSTRAINT_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CONSTRAINT_TYPE</code></td>
          <td></td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <code class="literal">CONSTRAINT_TYPE</code> value can be
          <code class="literal">UNIQUE</code>, <code class="literal">PRIMARY KEY</code>, or
          <code class="literal">FOREIGN KEY</code>.
        </p></li><li class="listitem"><p>
          The <code class="literal">UNIQUE</code> and <code class="literal">PRIMARY
          KEY</code> information is about the same as what you get
          from the <code class="literal">Key_name</code> field in the output from
          <a class="link" href="sql-syntax.html#show-index" title="13.7.5.22 SHOW INDEX Syntax"><code class="literal">SHOW INDEX</code></a> when the
          <code class="literal">Non_unique</code> field is <code class="literal">0</code>.
        </p></li><li class="listitem"><p>
          The <code class="literal">CONSTRAINT_TYPE</code> column can contain one
          of these values: <code class="literal">UNIQUE</code>, <code class="literal">PRIMARY
          KEY</code>, <code class="literal">FOREIGN KEY</code>,
          <code class="literal">CHECK</code>. This is a
          <a class="link" href="data-types.html#char" title="11.4.1 The CHAR and VARCHAR Types"><code class="literal">CHAR</code></a> (not
          <a class="link" href="data-types.html#enum" title="11.4.4 The ENUM Type"><code class="literal">ENUM</code></a>) column. The
          <code class="literal">CHECK</code> value is not available until we
          support <code class="literal">CHECK</code>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="table-privileges-table"></a>24.27 The INFORMATION_SCHEMA TABLE_PRIVILEGES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591471776"></a><p>
      The <a class="link" href="information-schema.html#table-privileges-table" title="24.27 The INFORMATION_SCHEMA TABLE_PRIVILEGES Table"><code class="literal">TABLE_PRIVILEGES</code></a> table provides
      information about table privileges. This information comes from
      the <code class="literal">mysql.tables_priv</code> grant table.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA TABLE_PRIVILEGES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">GRANTEE</code></td>
          <td></td>
          <td><code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
            value</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">PRIVILEGE_TYPE</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_GRANTABLE</code></td>
          <td></td>
          <td></td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">PRIVILEGE_TYPE</code> can contain one (and only
          one) of these values: <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a>,
          <a class="link" href="security.html#priv_insert"><code class="literal">INSERT</code></a>,
          <a class="link" href="security.html#priv_update"><code class="literal">UPDATE</code></a>,
          <a class="link" href="security.html#priv_references"><code class="literal">REFERENCES</code></a>,
          <a class="link" href="security.html#priv_alter"><code class="literal">ALTER</code></a>,
          <a class="link" href="security.html#priv_index"><code class="literal">INDEX</code></a>,
          <a class="link" href="security.html#priv_drop"><code class="literal">DROP</code></a>,
          <a class="link" href="security.html#priv_create-view"><code class="literal">CREATE VIEW</code></a>.
</p></li></ul>
</div>
<p>
      The following statements are <span class="emphasis"><em>not</em></span> equivalent:
    </p><pre data-lang="sql" class="programlisting">
SELECT ... FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES

SHOW GRANTS ...
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="triggers-table"></a>24.28 The INFORMATION_SCHEMA TRIGGERS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591420240"></a><p>
      The <a class="link" href="information-schema.html#triggers-table" title="24.28 The INFORMATION_SCHEMA TRIGGERS Table"><code class="literal">TRIGGERS</code></a> table provides
      information about triggers. To see information about a table's
      triggers, you must have the <a class="link" href="security.html#priv_trigger"><code class="literal">TRIGGER</code></a>
      privilege for the table.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA TRIGGERS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TRIGGER_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TRIGGER_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TRIGGER_NAME</code></td>
          <td><code class="literal">Trigger</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_MANIPULATION</code></td>
          <td><code class="literal">Event</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_OBJECT_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_OBJECT_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">EVENT_OBJECT_TABLE</code></td>
          <td><code class="literal">Table</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_ORDER</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_CONDITION</code></td>
          <td></td>
          <td><code class="literal">NULL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_STATEMENT</code></td>
          <td><code class="literal">Statement</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_ORIENTATION</code></td>
          <td></td>
          <td><code class="literal">ROW</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_TIMING</code></td>
          <td><code class="literal">Timing</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_REFERENCE_OLD_TABLE</code></td>
          <td></td>
          <td><code class="literal">NULL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_REFERENCE_NEW_TABLE</code></td>
          <td></td>
          <td><code class="literal">NULL</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_REFERENCE_OLD_ROW</code></td>
          <td></td>
          <td><code class="literal">OLD</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">ACTION_REFERENCE_NEW_ROW</code></td>
          <td></td>
          <td><code class="literal">NEW</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">CREATED</code></td>
          <td><code class="literal">Created</code></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SQL_MODE</code></td>
          <td><code class="literal">sql_mode</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DEFINER</code></td>
          <td><code class="literal">Definer</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_CLIENT</code></td>
          <td><code class="literal">character_set_client</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION_CONNECTION</code></td>
          <td><code class="literal">collation_connection</code></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATABASE_COLLATION</code></td>
          <td><code class="literal">Database Collation</code></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The names in the <span class="quote">“<span class="quote"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a>
          Name</span>”</span> column refer to the <a class="link" href="sql-syntax.html#show-triggers" title="13.7.5.38 SHOW TRIGGERS Syntax"><code class="literal">SHOW
          TRIGGERS</code></a> statement, not <a class="link" href="sql-syntax.html#show-create-trigger" title="13.7.5.11 SHOW CREATE TRIGGER Syntax"><code class="literal">SHOW
          CREATE TRIGGER</code></a>. See <a class="xref" href="sql-syntax.html#show-triggers" title="13.7.5.38 SHOW TRIGGERS Syntax">Section 13.7.5.38, “SHOW TRIGGERS Syntax”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">TRIGGER_SCHEMA</code> and
          <code class="literal">TRIGGER_NAME</code>: The name of the database in
          which the trigger occurs and the trigger name, respectively.
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_MANIPULATION</code>: The trigger event. This
          is the type of operation on the associated table for which the
          trigger activates. The value is <code class="literal">'INSERT'</code> (a
          row was inserted), <code class="literal">'DELETE'</code> (a row was
          deleted), or <code class="literal">'UPDATE'</code> (a row was modified).
        </p></li><li class="listitem"><p>
          <code class="literal">EVENT_OBJECT_SCHEMA</code> and
          <code class="literal">EVENT_OBJECT_TABLE</code>: As noted in
          <a class="xref" href="stored-programs-views.html#triggers" title="23.3 Using Triggers">Section 23.3, “Using Triggers”</a>, every trigger is associated with
          exactly one table. These columns indicate the database in
          which this table occurs, and the table name, respectively.
        </p></li><li class="listitem"><p>
          <code class="literal">ACTION_ORDER</code>: The ordinal position of the
          trigger's action within the list of triggers on the same table
          with the same <code class="literal">EVENT_MANIPULATION</code> and
          <code class="literal">ACTION_TIMING</code> values. Before MySQL 5.7.2,
          this value is always <code class="literal">0</code> because it is not
          possible for a table to have more than one trigger with the
          same <code class="literal">EVENT_MANIPULATION</code> and
          <code class="literal">ACTION_TIMING</code> values.
        </p></li><li class="listitem"><p>
          <code class="literal">ACTION_STATEMENT</code>: The trigger body; that
          is, the statement executed when the trigger activates. This
          text uses UTF-8 encoding.
        </p></li><li class="listitem"><p>
          <code class="literal">ACTION_ORIENTATION</code>: Always contains the
          value <code class="literal">'ROW'</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">ACTION_TIMING</code>: Whether the trigger
          activates before or after the triggering event. The value is
          <code class="literal">'BEFORE'</code> or <code class="literal">'AFTER'</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">ACTION_REFERENCE_OLD_ROW</code> and
          <code class="literal">ACTION_REFERENCE_NEW_ROW</code>: The old and new
          column identifiers, respectively. This means that
          <code class="literal">ACTION_REFERENCE_OLD_ROW</code> always contains
          the value <code class="literal">'OLD'</code> and
          <code class="literal">ACTION_REFERENCE_NEW_ROW</code> always contains
          the value <code class="literal">'NEW'</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">CREATED</code>: The date and time when the trigger
          was created. This is a <code class="literal">TIMESTAMP(2)</code> value
          (with a fractional part in hundredths of seconds) for triggers
          created in MySQL 5.7.2 or later, <code class="literal">NULL</code> for
          triggers created prior to 5.7.2.
        </p></li><li class="listitem"><p>
          <code class="literal">SQL_MODE</code>: The SQL mode in effect when the
          trigger was created, and under which the trigger executes. For
          the permitted values, see <a class="xref" href="server-administration.html#sql-mode" title="5.1.10 Server SQL Modes">Section 5.1.10, “Server SQL Modes”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">DEFINER</code>: The account of the user who
          created the trigger, in
          <code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
          format.
        </p></li><li class="listitem"><p>
          <code class="literal">CHARACTER_SET_CLIENT</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_character_set_client"><code class="literal">character_set_client</code></a>
          system variable when the trigger was created.
        </p></li><li class="listitem"><p>
          <code class="literal">COLLATION_CONNECTION</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_collation_connection"><code class="literal">collation_connection</code></a>
          system variable when the trigger was created.
        </p></li><li class="listitem"><p>
          <code class="literal">DATABASE_COLLATION</code>: The collation of the
          database with which the trigger is associated.
        </p></li><li class="listitem"><p>
          The following columns currently always contain
          <code class="literal">NULL</code>: <code class="literal">ACTION_CONDITION</code>,
          <code class="literal">ACTION_REFERENCE_OLD_TABLE</code>, and
          <code class="literal">ACTION_REFERENCE_NEW_TABLE</code>.
</p></li></ul>
</div>
<p>
      Example, using the <code class="literal">ins_sum</code> trigger defined in
      <a class="xref" href="stored-programs-views.html#triggers" title="23.3 Using Triggers">Section 23.3, “Using Triggers”</a>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.TRIGGERS</code></strong>
       <strong class="userinput"><code>WHERE TRIGGER_SCHEMA='test' AND TRIGGER_NAME='ins_sum'\G</code></strong>
*************************** 1. row ***************************
           TRIGGER_CATALOG: def
            TRIGGER_SCHEMA: test
              TRIGGER_NAME: ins_sum
        EVENT_MANIPULATION: INSERT
      EVENT_OBJECT_CATALOG: def
       EVENT_OBJECT_SCHEMA: test
        EVENT_OBJECT_TABLE: account
              ACTION_ORDER: 1
          ACTION_CONDITION: NULL
          ACTION_STATEMENT: SET @sum = @sum + NEW.amount
        ACTION_ORIENTATION: ROW
             ACTION_TIMING: BEFORE
ACTION_REFERENCE_OLD_TABLE: NULL
ACTION_REFERENCE_NEW_TABLE: NULL
  ACTION_REFERENCE_OLD_ROW: OLD
  ACTION_REFERENCE_NEW_ROW: NEW
                   CREATED: 2013-07-05 07:41:21.26
                  SQL_MODE: NO_ENGINE_SUBSTITUTION
                   DEFINER: me@localhost
      CHARACTER_SET_CLIENT: utf8
      COLLATION_CONNECTION: utf8_general_ci
        DATABASE_COLLATION: latin1_swedish_ci
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="user-privileges-table"></a>24.29 The INFORMATION_SCHEMA USER_PRIVILEGES Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591261296"></a><p>
      The <a class="link" href="information-schema.html#user-privileges-table" title="24.29 The INFORMATION_SCHEMA USER_PRIVILEGES Table"><code class="literal">USER_PRIVILEGES</code></a> table provides
      information about global privileges. This information comes from
      the <code class="literal">mysql.user</code> grant table.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA USER_PRIVILEGES table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">GRANTEE</code></td>
          <td></td>
          <td><code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
            value, MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code>, MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">PRIVILEGE_TYPE</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_GRANTABLE</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This is a nonstandard table. It takes its values from the
          <code class="literal">mysql.user</code> table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="views-table"></a>24.30 The INFORMATION_SCHEMA VIEWS Table</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591227680"></a><p>
      The <a class="link" href="information-schema.html#views-table" title="24.30 The INFORMATION_SCHEMA VIEWS Table"><code class="literal">VIEWS</code></a> table provides information
      about views in databases. You must have the
      <a class="link" href="security.html#priv_show-view"><code class="literal">SHOW VIEW</code></a> privilege to access this
      table.
</p>
<div class="informaltable">
<table summary="Columns in the INFORMATION_SCHEMA VIEWS table."><col width="40%"><col width="30%"><col width="30%"><thead><tr>
          <th scope="col"><code class="literal">INFORMATION_SCHEMA</code> Name</th>
          <th scope="col"><a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> Name</th>
          <th scope="col">Remarks</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_CATALOG</code></td>
          <td></td>
          <td><code class="literal">def</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_SCHEMA</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">VIEW_DEFINITION</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CHECK_OPTION</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_UPDATABLE</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">DEFINER</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">SECURITY_TYPE</code></td>
          <td></td>
          <td></td>
        </tr><tr>
          <td scope="row"><code class="literal">CHARACTER_SET_CLIENT</code></td>
          <td></td>
          <td>MySQL extension</td>
        </tr><tr>
          <td scope="row"><code class="literal">COLLATION_CONNECTION</code></td>
          <td></td>
          <td>MySQL extension</td>
</tr></tbody></table>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The <code class="literal">VIEW_DEFINITION</code> column has most of what
          you see in the <code class="literal">Create Table</code> field that
          <a class="link" href="sql-syntax.html#show-create-view" title="13.7.5.13 SHOW CREATE VIEW Syntax"><code class="literal">SHOW CREATE VIEW</code></a> produces. Skip
          the words before <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> and
          skip the words <code class="literal">WITH CHECK OPTION</code>. Suppose
          that the original statement was:
        </p><pre data-lang="sql" class="programlisting">
CREATE VIEW v AS
  SELECT s2,s1 FROM t
  WHERE s1 &gt; 5
  ORDER BY s1
  WITH CHECK OPTION;
</pre><p>
          Then the view definition looks like this:
        </p><pre data-lang="sql" class="programlisting">
SELECT s2,s1 FROM t WHERE s1 &gt; 5 ORDER BY s1
</pre></li><li class="listitem"><p>
          The <code class="literal">CHECK_OPTION</code> column has a value of
          <code class="literal">NONE</code>, <code class="literal">CASCADE</code>, or
          <code class="literal">LOCAL</code>.
        </p></li><li class="listitem"><p>
          MySQL sets a flag, called the view updatability flag, at
          <a class="link" href="sql-syntax.html#create-view" title="13.1.21 CREATE VIEW Syntax"><code class="literal">CREATE VIEW</code></a> time. The flag is
          set to <code class="literal">YES</code> (true) if
          <a class="link" href="sql-syntax.html#update" title="13.2.11 UPDATE Syntax"><code class="literal">UPDATE</code></a> and
          <a class="link" href="sql-syntax.html#delete" title="13.2.2 DELETE Syntax"><code class="literal">DELETE</code></a> (and similar operations)
          are legal for the view. Otherwise, the flag is set to
          <code class="literal">NO</code> (false). The
          <code class="literal">IS_UPDATABLE</code> column in the
          <a class="link" href="information-schema.html#views-table" title="24.30 The INFORMATION_SCHEMA VIEWS Table"><code class="literal">VIEWS</code></a> table displays the status
          of this flag.
        </p><p>
          If a view is not updatable, statements such
          <a class="link" href="sql-syntax.html#update" title="13.2.11 UPDATE Syntax"><code class="literal">UPDATE</code></a>,
          <a class="link" href="sql-syntax.html#delete" title="13.2.2 DELETE Syntax"><code class="literal">DELETE</code></a>, and
          <a class="link" href="sql-syntax.html#insert" title="13.2.5 INSERT Syntax"><code class="literal">INSERT</code></a> are illegal and will be
          rejected. (Note that even if a view is updatable, it might not
          be possible to insert into it; for details, refer to
          <a class="xref" href="stored-programs-views.html#view-updatability" title="23.5.3 Updatable and Insertable Views">Section 23.5.3, “Updatable and Insertable Views”</a>.)
        </p><p>
          The <code class="literal">IS_UPDATABLE</code> flag may be unreliable if
          a view depends on one or more other views, and one of these
          underlying views is updated. Regardless of the
          <code class="literal">IS_UPDATABLE</code> value, the server keeps track
          of the updatability of a view and correctly rejects data
          change operations to views that are not updatable. If the
          <code class="literal">IS_UPDATABLE</code> value for a view has become
          inaccurate to due to changes to underlying views, the value
          can be updated by deleting and recreating the view.
        </p></li><li class="listitem"><p>
          <code class="literal">DEFINER</code>: The account of the user who
          created the view, in
          <code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
          format. <code class="literal">SECURITY_TYPE</code> has a value of
          <code class="literal">DEFINER</code> or <code class="literal">INVOKER</code>.
        </p></li><li class="listitem"><p>
          <code class="literal">CHARACTER_SET_CLIENT</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_character_set_client"><code class="literal">character_set_client</code></a>
          system variable when the view was created.
        </p></li><li class="listitem"><p>
          <code class="literal">COLLATION_CONNECTION</code>: The session value of
          the <a class="link" href="server-administration.html#sysvar_collation_connection"><code class="literal">collation_connection</code></a>
          system variable when the view was created.
</p></li></ul>
</div>
<p>
      MySQL lets you use different
      <a class="link" href="server-administration.html#sysvar_sql_mode"><code class="literal">sql_mode</code></a> settings to tell the
      server the type of SQL syntax to support. For example, you might
      use the <a class="link" href="server-administration.html#sqlmode_ansi"><code class="literal">ANSI</code></a> SQL mode to ensure
      MySQL correctly interprets the standard SQL concatenation
      operator, the double bar (<code class="literal">||</code>), in your queries.
      If you then create a view that concatenates items, you might worry
      that changing the <a class="link" href="server-administration.html#sysvar_sql_mode"><code class="literal">sql_mode</code></a>
      setting to a value different from
      <a class="link" href="server-administration.html#sqlmode_ansi"><code class="literal">ANSI</code></a> could cause the view to
      become invalid. But this is not the case. No matter how you write
      out a view definition, MySQL always stores it the same way, in a
      canonical form. Here is an example that shows how the server
      changes a double bar concatenation operator to a
      <a class="link" href="functions.html#function_concat"><code class="literal">CONCAT()</code></a> function:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SET sql_mode = 'ANSI';</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>CREATE VIEW test.v AS SELECT 'a' || 'b' as col1;</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS</code></strong>
       <strong class="userinput"><code>WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME = 'v';</code></strong>
+----------------------------------+
| VIEW_DEFINITION                  |
+----------------------------------+
| select concat('a','b') AS `col1` |
+----------------------------------+
1 row in set (0.00 sec)
</pre><p>
      The advantage of storing a view definition in canonical form is
      that changes made later to the value of
      <a class="link" href="server-administration.html#sysvar_sql_mode"><code class="literal">sql_mode</code></a> will not affect the
      results from the view. However an additional consequence is that
      comments prior to <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> are
      stripped from the definition by the server.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="innodb-i_s-tables"></a>24.31 InnoDB INFORMATION_SCHEMA Tables</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="information-schema.html#innodb-buffer-page-table">24.31.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-buffer-page-lru-table">24.31.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-buffer-pool-stats-table">24.31.3 The INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-cmp-table">24.31.4 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-cmpmem-table">24.31.5 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-cmp-per-index-table">24.31.6 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and
INNODB_CMP_PER_INDEX_RESET Tables</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-being-deleted-table">24.31.7 The INFORMATION_SCHEMA INNODB_FT_BEING_DELETED Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-config-table">24.31.8 The INFORMATION_SCHEMA INNODB_FT_CONFIG Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-default-stopword-table">24.31.9 The INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-deleted-table">24.31.10 The INFORMATION_SCHEMA INNODB_FT_DELETED Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-index-cache-table">24.31.11 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-ft-index-table-table">24.31.12 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-locks-table">24.31.13 The INFORMATION_SCHEMA INNODB_LOCKS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-lock-waits-table">24.31.14 The INFORMATION_SCHEMA INNODB_LOCK_WAITS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-metrics-table">24.31.15 The INFORMATION_SCHEMA INNODB_METRICS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-columns-table">24.31.16 The INFORMATION_SCHEMA INNODB_SYS_COLUMNS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-datafiles-table">24.31.17 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-fields-table">24.31.18 The INFORMATION_SCHEMA INNODB_SYS_FIELDS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-foreign-table">24.31.19 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-foreign-cols-table">24.31.20 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN_COLS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-indexes-table">24.31.21 The INFORMATION_SCHEMA INNODB_SYS_INDEXES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-tables-table">24.31.22 The INFORMATION_SCHEMA INNODB_SYS_TABLES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-tablespaces-table">24.31.23 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-tablestats-table">24.31.24 The INFORMATION_SCHEMA INNODB_SYS_TABLESTATS View</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-sys-virtual-table">24.31.25 The INFORMATION_SCHEMA INNODB_SYS_VIRTUAL Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-temp-table-info-table">24.31.26 The INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO Table</a></span></dt><dt><span class="section"><a href="information-schema.html#innodb-trx-table">24.31.27 The INFORMATION_SCHEMA INNODB_TRX Table</a></span></dt></dl>
</div>
<a class="indexterm" name="idm140710591122768"></a><a class="indexterm" name="idm140710591121312"></a><p>
    This section provides table definitions for
    <code class="literal">InnoDB</code> <code class="literal">INFORMATION_SCHEMA</code>
    tables. For related information and examples, see
    <a class="xref" href="innodb-storage-engine.html#innodb-information-schema" title="14.15 InnoDB INFORMATION_SCHEMA Tables">Section 14.15, “InnoDB INFORMATION_SCHEMA Tables”</a>.
  </p><p>
    <code class="literal">InnoDB</code> <code class="literal">INFORMATION_SCHEMA</code>
    tables can be used to monitor ongoing <code class="literal">InnoDB</code>
    activity, to detect inefficiencies before they turn into issues, or
    to troubleshoot performance and capacity issues. As your database
    becomes bigger and busier, running up against the limits of your
    hardware capacity, you monitor and tune these aspects to keep the
    database running smoothly.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-buffer-page-table"></a>24.31.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm140710591112784"></a><p>
      The <code class="literal">INNODB_BUFFER_PAGE</code> table holds information
      about each <a class="link" href="glossary.html#glos_page" title="page">page</a> in the
      <code class="literal">InnoDB</code> <a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">buffer
      pool</a>.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-buffer-pool-tables" title="14.15.5 InnoDB INFORMATION_SCHEMA Buffer Pool Tables">Section 14.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”</a>.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
        Querying the <code class="literal">INNODB_BUFFER_PAGE</code> table can
        introduce significant performance overhead. Do not query this
        table on a production system unless you are aware of the
        performance impact that your query may have, and have determined
        it to be acceptable. To avoid impacting performance, reproduce
        the issue you want to investigate on a test instance and query
        the <code class="literal">INNODB_BUFFER_PAGE</code> table on the test
        instance.
</p>
</div>

<div class="table">
<a name="innodb-information-schema-innodb_buffer_page_table"></a><p class="title"><b>Table 24.1 INNODB_BUFFER_PAGE Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_BUFFER_PAGE table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">POOL_ID</code></td>
          <td>Buffer Pool ID. An identifier to distinguish between multiple buffer
            pool instances.</td>
        </tr><tr>
          <td scope="row"><code class="literal">BLOCK_ID</code></td>
          <td>Buffer Pool Block ID.</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPACE</code></td>
          <td>Tablespace ID. Uses the same value as in
            <code class="literal">INNODB_SYS_TABLES.SPACE</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_NUMBER</code></td>
          <td>Page number.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_TYPE</code></td>
          <td>Page type. Permitted values are: <code class="literal">ALLOCATED</code> (Freshly
            allocated page), <code class="literal">INDEX</code> (B-tree node),
            <code class="literal">UNDO_LOG</code> (Undo log page),
            <code class="literal">INODE</code> (Index node),
            <code class="literal">IBUF_FREE_LIST</code> (Insert buffer free list),
            <code class="literal">IBUF_BITMAP</code> (Insert buffer bitmap),
            <code class="literal">SYSTEM</code> (System page),
            <code class="literal">TRX_SYSTEM</code> (Transaction system data),
            <code class="literal">FILE_SPACE_HEADER</code> (File space header),
            <code class="literal">EXTENT_DESCRIPTOR</code> (Extent descriptor
            page), <code class="literal">BLOB</code> (Uncompressed BLOB page),
            <code class="literal">COMPRESSED_BLOB</code> (First compressed BLOB
            page), <code class="literal">COMPRESSED_BLOB2</code> (Subsequent comp
            BLOB page), <code class="literal">IBUF_INDEX</code> (Insert buffer
            index), <code class="literal">RTREE_INDEX</code> (R-tree index),
            <code class="literal">UNKNOWN</code> (unknown).</td>
        </tr><tr>
          <td scope="row"><code class="literal">FLUSH_TYPE</code></td>
          <td>Flush type.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FIX_COUNT</code></td>
          <td>Number of threads using this block within the buffer pool. When zero,
            the block is eligible to be evicted.</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_HASHED</code></td>
          <td>Whether hash index has been built on this page.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NEWEST_MODIFICATION</code></td>
          <td>Log Sequence Number of the youngest modification.</td>
        </tr><tr>
          <td scope="row"><code class="literal">OLDEST_MODIFICATION</code></td>
          <td>Log Sequence Number of the oldest modification.</td>
        </tr><tr>
          <td scope="row"><code class="literal">ACCESS_TIME</code></td>
          <td>An abstract number used to judge the first access time of the page.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td>Name of the table the page belongs to. This column is only applicable to
            pages of type <code class="literal">INDEX</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_NAME</code></td>
          <td>Name of the index the page belongs to. It can be the name of a clustered
            index or a secondary index. This column is only applicable
            to pages of type <code class="literal">INDEX</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_RECORDS</code></td>
          <td>Number of records within the page.</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_SIZE</code></td>
          <td>Sum of the sizes of the records. This column is only applicable to pages
            of type <code class="literal">INDEX</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESSED_SIZE</code></td>
          <td>Compressed page size. Null for pages that are not compressed.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_STATE</code></td>
          <td>Page state. Possible values include: <code class="literal">NULL</code> (clean
            compressed pages, compressed pages in the flush list, pages
            used as buffer pool watch sentinels),
            <code class="literal">NOT_USED</code> (in the free list),
            <code class="literal">READY_FOR_USE</code> (a free page),
            <code class="literal">FILE_PAGE</code> (a buffered file page),
            <code class="literal">MEMORY</code> (contains a main memory object),
            <code class="literal">REMOVE_HASH</code> (hash index should be removed
            before placing in the free list).</td>
        </tr><tr>
          <td scope="row"><code class="literal">IO_FIX</code></td>
          <td>Specifies whether any I/O is pending for this page:
            <code class="literal">IO_NONE</code> = no pending I/O,
            <code class="literal">IO_READ</code> = read pending,
            <code class="literal">IO_WRITE</code> = write pending.</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_OLD</code></td>
          <td>Specifies whether or not the block is in the sublist of old blocks in
            the LRU list.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FREE_PAGE_CLOCK</code></td>
          <td>The value of the <code class="literal">freed_page_clock</code> counter when the
            block was the last placed at the head of the LRU list. The
            <code class="literal">freed_page_clock</code> counter tracks the
            number of blocks removed from the end of the LRU list.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE LIMIT 1\G</code></strong>
*************************** 1. row ***************************
            POOL_ID: 0
           BLOCK_ID: 0
              SPACE: 97
        PAGE_NUMBER: 2473
          PAGE_TYPE: INDEX
         FLUSH_TYPE: 1
          FIX_COUNT: 0
          IS_HASHED: YES
NEWEST_MODIFICATION: 733855581
OLDEST_MODIFICATION: 0
        ACCESS_TIME: 3378385672
         TABLE_NAME: `employees`.`salaries`
         INDEX_NAME: PRIMARY
     NUMBER_RECORDS: 468
          DATA_SIZE: 14976
    COMPRESSED_SIZE: 0
         PAGE_STATE: FILE_PAGE
             IO_FIX: IO_NONE
             IS_OLD: YES
    FREE_PAGE_CLOCK: 66
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table is primarily useful for expert-level performance
          monitoring, or when developing performance-related extensions
          for MySQL.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          When tables, table rows, partitions, or indexes are deleted,
          associated pages remain in the buffer pool until space is
          required for other data. The
          <code class="literal">INNODB_BUFFER_PAGE</code> table reports
          information about these pages until they are evicted from the
          buffer pool. For more information about how the
          <code class="literal">InnoDB</code> manages buffer pool data, see
          <a class="xref" href="innodb-storage-engine.html#innodb-buffer-pool" title="14.6.3.1 The InnoDB Buffer Pool">Section 14.6.3.1, “The InnoDB Buffer Pool”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-buffer-page-lru-table"></a>24.31.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710591001408"></a><p>
      The <code class="literal">INNODB_BUFFER_PAGE_LRU</code> table holds
      information about the pages in the <code class="literal">InnoDB</code>
      <a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">buffer pool</a>, in particular
      how they are ordered in the LRU list that determines which pages
      to <a class="link" href="glossary.html#glos_eviction" title="eviction">evict</a> from the buffer pool
      when it becomes full.
    </p><p>
      The <a class="link" href="information-schema.html#innodb-buffer-page-lru-table" title="24.31.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table"><code class="literal">INNODB_BUFFER_PAGE_LRU</code></a> table has
      the same columns as the
      <a class="link" href="information-schema.html#innodb-buffer-page-table" title="24.31.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table"><code class="literal">INNODB_BUFFER_PAGE</code></a> table, except that
      the <a class="link" href="information-schema.html#innodb-buffer-page-lru-table" title="24.31.2 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU Table"><code class="literal">INNODB_BUFFER_PAGE_LRU</code></a> table has
      an <code class="literal">LRU_POSITION</code> column instead of a
      <code class="literal">BLOCK_ID</code> column.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-buffer-pool-tables" title="14.15.5 InnoDB INFORMATION_SCHEMA Buffer Pool Tables">Section 14.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”</a>.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
        Querying the <code class="literal">INNODB_BUFFER_PAGE_LRU</code> table can
        introduce significant performance overhead. Do not query this
        table on a production system unless you are aware of the
        performance impact that your query may have, and have determined
        it to be acceptable. To avoid impacting performance, reproduce
        the issue you want to investigate on a test instance and query
        the <code class="literal">INNODB_BUFFER_PAGE_LRU</code> table on the test
        instance.
</p>
</div>

<div class="table">
<a name="innodb-information-schema-innodb_buffer_page_lru_table"></a><p class="title"><b>Table 24.2 INNODB_BUFFER_PAGE_LRU Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_BUFFER_PAGE_LRU table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">POOL_ID</code></td>
          <td>Buffer Pool ID. An identifier to distinguish between multiple buffer
            pool instances.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LRU_POSITION</code></td>
          <td>The position of the page in the LRU list.</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPACE</code></td>
          <td>Tablespace ID. Uses the same value as in
            <code class="literal">INNODB_SYS_TABLES.SPACE</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_NUMBER</code></td>
          <td>Page number.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_TYPE</code></td>
          <td>Page type. Permitted values are: <code class="literal">ALLOCATED</code> (Freshly
            allocated page), <code class="literal">INDEX</code> (B-tree node),
            <code class="literal">UNDO_LOG</code> (Undo log page),
            <code class="literal">INODE</code> (Index node),
            <code class="literal">IBUF_FREE_LIST</code> (Insert buffer free list),
            <code class="literal">IBUF_BITMAP</code> (Insert buffer bitmap),
            <code class="literal">SYSTEM</code> (System page),
            <code class="literal">TRX_SYSTEM</code> (Transaction system data),
            <code class="literal">FILE_SPACE_HEADER</code> (File space header),
            <code class="literal">EXTENT_DESCRIPTOR</code> (Extent descriptor
            page), <code class="literal">BLOB</code> (Uncompressed BLOB page),
            <code class="literal">COMPRESSED_BLOB</code> (First compressed BLOB
            page), <code class="literal">COMPRESSED_BLOB2</code> (Subsequent comp
            BLOB page), <code class="literal">IBUF_INDEX</code> (Insert buffer
            index), <code class="literal">RTREE_INDEX</code> (R-tree index),
            <code class="literal">UNKNOWN</code> (unknown).</td>
        </tr><tr>
          <td scope="row"><code class="literal">FLUSH_TYPE</code></td>
          <td>Flush type.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FIX_COUNT</code></td>
          <td>Number of threads using this block within the buffer pool. When zero,
            the block is eligible to be evicted.</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_HASHED</code></td>
          <td>Whether hash index has been built on this page.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NEWEST_MODIFICATION</code></td>
          <td>Log Sequence Number of the youngest modification.</td>
        </tr><tr>
          <td scope="row"><code class="literal">OLDEST_MODIFICATION</code></td>
          <td>Log Sequence Number of the oldest modification.</td>
        </tr><tr>
          <td scope="row"><code class="literal">ACCESS_TIME</code></td>
          <td>An abstract number used to judge the first access time of the page.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td>Name of the table the page belongs to. This column is only applicable to
            pages of type <code class="literal">INDEX</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_NAME</code></td>
          <td>Name of the index the page belongs to. It can be the name of a clustered
            index or a secondary index. This column is only applicable
            to pages of type <code class="literal">INDEX</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_RECORDS</code></td>
          <td>Number of records within the page.</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATA_SIZE</code></td>
          <td>Sum of the sizes of the records. This column is only applicable to pages
            of type <code class="literal">INDEX</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESSED_SIZE</code></td>
          <td>Compressed page size. Null for pages that are not compressed.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_STATE</code></td>
          <td>Page state. Possible values include: <code class="literal">NULL</code> (clean
            compressed pages, compressed pages in the flush list, pages
            used as buffer pool watch sentinels),
            <code class="literal">NOT_USED</code> (in the free list),
            <code class="literal">READY_FOR_USE</code> (a free page),
            <code class="literal">FILE_PAGE</code> (a buffered file page),
            <code class="literal">MEMORY</code> (contains a main memory object),
            <code class="literal">REMOVE_HASH</code> (hash index should be removed
            before placing in the free list).</td>
        </tr><tr>
          <td scope="row"><code class="literal">IO_FIX</code></td>
          <td>Specifies whether any I/O is pending for this page:
            <code class="literal">IO_NONE</code> = no pending I/O,
            <code class="literal">IO_READ</code> = read pending,
            <code class="literal">IO_WRITE</code> = write pending.</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_OLD</code></td>
          <td>Specifies whether or not the block is in the sublist of old blocks in
            the LRU list.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FREE_PAGE_CLOCK</code></td>
          <td>The value of the <code class="literal">freed_page_clock</code> counter when the
            block was the last placed at the head of the LRU list. The
            <code class="literal">freed_page_clock</code> counter tracks the
            number of blocks removed from the end of the LRU list.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<h4><a name="idm140710590900016"></a>Example</h4>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU LIMIT 1\G</code></strong>
*************************** 1. row ***************************
            POOL_ID: 0
       LRU_POSITION: 0
              SPACE: 97
        PAGE_NUMBER: 1984
          PAGE_TYPE: INDEX
         FLUSH_TYPE: 1
          FIX_COUNT: 0
          IS_HASHED: YES
NEWEST_MODIFICATION: 719490396
OLDEST_MODIFICATION: 0
        ACCESS_TIME: 3378383796
         TABLE_NAME: `employees`.`salaries`
         INDEX_NAME: PRIMARY
     NUMBER_RECORDS: 468
          DATA_SIZE: 14976
    COMPRESSED_SIZE: 0
         COMPRESSED: NO
             IO_FIX: IO_NONE
             IS_OLD: YES
    FREE_PAGE_CLOCK: 0
</pre>
<h4><a name="idm140710590897056"></a>Notes</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table is primarily useful for expert-level performance
          monitoring, or when developing performance-related extensions
          for MySQL.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          Querying this table can require MySQL to allocate a large
          block of contiguous memory, more than 64 bytes time the number
          of active pages in the buffer pool. This allocation could
          potentially cause an out-of-memory error, especially for
          systems with multi-gigabyte buffer pools.
        </p></li><li class="listitem"><p>
          Querying this table requires MySQL to lock the data structure
          representing the buffer pool while traversing the LRU list,
          which can reduce concurrency, especially for systems with
          multi-gigabyte buffer pools.
        </p></li><li class="listitem"><p>
          When tables, table rows, partitions, or indexes are deleted,
          associated pages remain in the buffer pool until space is
          required for other data. The
          <code class="literal">INNODB_BUFFER_PAGE_LRU</code> table reports
          information about these pages until they are evicted from the
          buffer pool. For more information about how the
          <code class="literal">InnoDB</code> manages buffer pool data, see
          <a class="xref" href="innodb-storage-engine.html#innodb-buffer-pool" title="14.6.3.1 The InnoDB Buffer Pool">Section 14.6.3.1, “The InnoDB Buffer Pool”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-buffer-pool-stats-table"></a>24.31.3 The INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590882864"></a><p>
      The <code class="literal">INNODB_BUFFER_POOL_STATS</code> table provides
      much of the same buffer pool information provided in <code class="literal">SHOW
      ENGINE INNODB STATUS</code> output. Much of the same
      information may also be obtained using <code class="literal">InnoDB</code>
      buffer pool <a class="link" href="server-administration.html#server-status-variables" title="5.1.9 Server Status Variables">server status
      variables</a>.
    </p><p>
      The idea of making pages in the buffer pool <span class="quote">“<span class="quote">young</span>”</span>
      or <span class="quote">“<span class="quote">not young</span>”</span> refers to transferring them between
      the <a class="link" href="glossary.html#glos_sublist" title="sublist">sublists</a> at the head and
      tail of the buffer pool data structure. Pages made
      <span class="quote">“<span class="quote">young</span>”</span> take longer to age out of the buffer pool,
      while pages made <span class="quote">“<span class="quote">not young</span>”</span> are moved much closer to
      the point of <a class="link" href="glossary.html#glos_eviction" title="eviction">eviction</a>.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-buffer-pool-tables" title="14.15.5 InnoDB INFORMATION_SCHEMA Buffer Pool Tables">Section 14.15.5, “InnoDB INFORMATION_SCHEMA Buffer Pool Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_buffer_pool_stats_table"></a><p class="title"><b>Table 24.3 INNODB_BUFFER_POOL_STATS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_BUFFER_POOL_STATS table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">POOL_ID</code></td>
          <td>Buffer Pool ID. A unique identifier to distinguish between multiple
            buffer pool instances.</td>
        </tr><tr>
          <td scope="row"><code class="literal">POOL_SIZE</code></td>
          <td>The <code class="literal">InnoDB</code> buffer pool size in pages.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FREE_BUFFERS</code></td>
          <td>The number of free pages in the <code class="literal">InnoDB</code> buffer pool</td>
        </tr><tr>
          <td scope="row"><code class="literal">DATABASE_PAGES</code></td>
          <td>The number of pages in the <code class="literal">InnoDB</code> buffer pool
            containing data. The number includes both dirty and clean
            pages.</td>
        </tr><tr>
          <td scope="row"><code class="literal">OLD_DATABASE_PAGES</code></td>
          <td>The number of pages in the <code class="literal">old</code> buffer pool sublist.</td>
        </tr><tr>
          <td scope="row"><code class="literal">MODIFIED_DATABASE_PAGES</code></td>
          <td>The number of modified (dirty) database pages</td>
        </tr><tr>
          <td scope="row"><code class="literal">PENDING_DECOMPRESS</code></td>
          <td>The number of pages pending decompression</td>
        </tr><tr>
          <td scope="row"><code class="literal">PENDING_READS</code></td>
          <td>The number of pending reads</td>
        </tr><tr>
          <td scope="row"><code class="literal">PENDING_FLUSH_LRU</code></td>
          <td>The number of pages pending flush in the LRU</td>
        </tr><tr>
          <td scope="row"><code class="literal">PENDING_FLUSH_LIST</code></td>
          <td>The number of pages pending flush in the flush list</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_MADE_YOUNG</code></td>
          <td>The number of pages made young</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_NOT_MADE_YOUNG</code></td>
          <td>The number of pages not made young</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_MADE_YOUNG_RATE</code></td>
          <td>The number of pages made young per second (pages made young since the
            last printout / time elapsed)</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_MADE_NOT_YOUNG_RATE</code></td>
          <td>The number of pages not made per second (pages not made young since the
            last printout / time elapsed)</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_PAGES_READ</code></td>
          <td>The number of pages read</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_PAGES_CREATED</code></td>
          <td>The number of pages created</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_PAGES_WRITTEN</code></td>
          <td>The number of pages written</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_READ_RATE</code></td>
          <td>The number of pages read per second (pages read since the last printout
            / time elapsed)</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_CREATE_RATE</code></td>
          <td>The number of pages created per second (pages created since the last
            printout / time elapsed)</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_WRITTEN_RATE</code></td>
          <td>The number of pages written per second (pages written since the last
            printout / time elapsed)</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_PAGES_GET</code></td>
          <td>The number of logical read requests.</td>
        </tr><tr>
          <td scope="row"><code class="literal">HIT_RATE</code></td>
          <td>The buffer pool hit rate</td>
        </tr><tr>
          <td scope="row"><code class="literal">YOUNG_MAKE_PER_THOUSAND_GETS</code></td>
          <td>The number of pages made young per thousand gets</td>
        </tr><tr>
          <td scope="row"><code class="literal">NOT_YOUNG_MAKE_PER_THOUSAND_GETS</code></td>
          <td>The number of pages not made young per thousand gets</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_PAGES_READ_AHEAD</code></td>
          <td>The number of pages read ahead</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUMBER_READ_AHEAD_EVICTED</code></td>
          <td>The number of pages read into the <code class="literal">InnoDB</code> buffer pool
            by the read-ahead background thread that were subsequently
            evicted without having been accessed by queries.</td>
        </tr><tr>
          <td scope="row"><code class="literal">READ_AHEAD_RATE</code></td>
          <td>The read ahead rate per second (pages read ahead since the last printout
            / time elapsed)</td>
        </tr><tr>
          <td scope="row"><code class="literal">READ_AHEAD_EVICTED_RATE</code></td>
          <td>The number of read ahead pages evicted without access per second (read
            ahead pages not accessed since the last printout / time
            elapsed)</td>
        </tr><tr>
          <td scope="row"><code class="literal">LRU_IO_TOTAL</code></td>
          <td>LRU IO total</td>
        </tr><tr>
          <td scope="row"><code class="literal">LRU_IO_CURRENT</code></td>
          <td>LRU IO for the current interval</td>
        </tr><tr>
          <td scope="row"><code class="literal">UNCOMPRESS_TOTAL</code></td>
          <td>Total number of pages decompressed</td>
        </tr><tr>
          <td scope="row"><code class="literal">UNCOMPRESS_CURRENT</code></td>
          <td>The number of pages decompressed in the current interval</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS\G</code></strong>
*************************** 1. row ***************************
                         POOL_ID: 0
                       POOL_SIZE: 8192
                    FREE_BUFFERS: 1
                  DATABASE_PAGES: 8085
              OLD_DATABASE_PAGES: 2964
         MODIFIED_DATABASE_PAGES: 0
              PENDING_DECOMPRESS: 0
                   PENDING_READS: 0
               PENDING_FLUSH_LRU: 0
              PENDING_FLUSH_LIST: 0
                PAGES_MADE_YOUNG: 22821
            PAGES_NOT_MADE_YOUNG: 3544303
           PAGES_MADE_YOUNG_RATE: 357.62602199870594
       PAGES_MADE_NOT_YOUNG_RATE: 0
               NUMBER_PAGES_READ: 2389
            NUMBER_PAGES_CREATED: 12385
            NUMBER_PAGES_WRITTEN: 13111
                 PAGES_READ_RATE: 0
               PAGES_CREATE_RATE: 0
              PAGES_WRITTEN_RATE: 0
                NUMBER_PAGES_GET: 33322210
                        HIT_RATE: 1000
    YOUNG_MAKE_PER_THOUSAND_GETS: 18
NOT_YOUNG_MAKE_PER_THOUSAND_GETS: 0
         NUMBER_PAGES_READ_AHEAD: 2024
       NUMBER_READ_AHEAD_EVICTED: 0
                 READ_AHEAD_RATE: 0
         READ_AHEAD_EVICTED_RATE: 0
                    LRU_IO_TOTAL: 0
                  LRU_IO_CURRENT: 0
                UNCOMPRESS_TOTAL: 0
              UNCOMPRESS_CURRENT: 0
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table is primarily useful for expert-level performance
          monitoring, or when developing performance-related extensions
          for MySQL.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-cmp-table"></a>24.31.4 The INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET Tables</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590757440"></a><a class="indexterm" name="idm140710590755968"></a><p>
      The <code class="literal">INNODB_CMP</code> and
      <code class="literal">INNODB_CMP_RESET</code> tables contain status
      information on operations related to
      <a class="link" href="glossary.html#glos_compression" title="compression">compressed</a>
      <code class="literal">InnoDB</code> tables.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_cmp_columns_table"></a><p class="title"><b>Table 24.4 Columns of INNODB_CMP and INNODB_CMP_RESET</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_CMP and INNODB_CMP_RESET tables."><col width="4%"><col width="11%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">PAGE_SIZE</code></td>
          <td>Compressed page size in bytes.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESS_OPS</code></td>
          <td>Number of times a B-tree page of the size <code class="literal">PAGE_SIZE</code>
            has been compressed. Pages are compressed whenever an empty
            page is created or the space for the uncompressed
            modification log runs out.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESS_OPS_OK</code></td>
          <td>Number of times a B-tree page of the size <code class="literal">PAGE_SIZE</code>
            has been successfully compressed. This count should never
            exceed <code class="literal">COMPRESS_OPS</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESS_TIME</code></td>
          <td>Total time in seconds spent in attempts to compress B-tree pages of the
            size <code class="literal">PAGE_SIZE</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">UNCOMPRESS_OPS</code></td>
          <td>Number of times a B-tree page of the size <code class="literal">PAGE_SIZE</code>
            has been uncompressed. B-tree pages are uncompressed
            whenever compression fails or at first access when the
            uncompressed page does not exist in the buffer pool.</td>
        </tr><tr>
          <td scope="row"><code class="literal">UNCOMPRESS_TIME</code></td>
          <td>Total time in seconds spent in uncompressing B-tree pages of the size
            <code class="literal">PAGE_SIZE</code>.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP\G</code></strong>
*************************** 1. row ***************************
      page_size: 1024
   compress_ops: 0
compress_ops_ok: 0
  compress_time: 0
 uncompress_ops: 0
uncompress_time: 0
*************************** 2. row ***************************
      page_size: 2048
   compress_ops: 0
compress_ops_ok: 0
  compress_time: 0
 uncompress_ops: 0
uncompress_time: 0
*************************** 3. row ***************************
      page_size: 4096
   compress_ops: 0
compress_ops_ok: 0
  compress_time: 0
 uncompress_ops: 0
uncompress_time: 0
*************************** 4. row ***************************
      page_size: 8192
   compress_ops: 86955
compress_ops_ok: 81182
  compress_time: 27
 uncompress_ops: 26828
uncompress_time: 5
*************************** 5. row ***************************
      page_size: 16384
   compress_ops: 0
compress_ops_ok: 0
  compress_time: 0
 uncompress_ops: 0
uncompress_time: 0
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use these tables to measure the effectiveness of
          <code class="literal">InnoDB</code> table
          <a class="link" href="glossary.html#glos_compression" title="compression">compression</a> in your
          database.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of these tables including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For usage information, see
          <a class="xref" href="innodb-storage-engine.html#innodb-compression-tuning-monitoring" title="14.9.1.4 Monitoring InnoDB Table Compression at Runtime">Section 14.9.1.4, “Monitoring InnoDB Table Compression at Runtime”</a> and
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-examples-compression-sect" title="14.15.1.3 Using the Compression Information Schema Tables">Section 14.15.1.3, “Using the Compression Information Schema Tables”</a>.
          For general information about <code class="literal">InnoDB</code> table
          compression, see <a class="xref" href="innodb-storage-engine.html#innodb-compression" title="14.9 InnoDB Table and Page Compression">Section 14.9, “InnoDB Table and Page Compression”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-cmpmem-table"></a>24.31.5 The INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET Tables</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590704560"></a><a class="indexterm" name="idm140710590703088"></a><p>
      The <code class="literal">INNODB_CMPMEM</code> and
      <code class="literal">INNODB_CMPMEM_RESET</code> tables contain status
      information on compressed <a class="link" href="glossary.html#glos_page" title="page">pages</a>
      within the <code class="literal">InnoDB</code>
      <a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">buffer pool</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_cmpmem_columns_table"></a><p class="title"><b>Table 24.5 Columns of INNODB_CMPMEM and INNODB_CMPMEM_RESET</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_CMPMEM and INNODB_CMPMEM_RESET tables."><col width="4%"><col width="11%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">PAGE_SIZE</code></td>
          <td>Block size in bytes. Each record of this table describes blocks of this
            size.</td>
        </tr><tr>
          <td scope="row"><code class="literal">BUFFER_POOL_INSTANCE</code></td>
          <td>A unique identifier for the buffer pool instance.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_USED</code></td>
          <td>Number of blocks of the size <code class="literal">PAGE_SIZE</code> that are
            currently in use.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGES_FREE</code></td>
          <td>Number of blocks of the size <code class="literal">PAGE_SIZE</code> that are
            currently available for allocation. This column shows the
            external fragmentation in the memory pool. Ideally, these
            numbers should be at most 1.</td>
        </tr><tr>
          <td scope="row"><code class="literal">RELOCATION_OPS</code></td>
          <td>Number of times a block of the size <code class="literal">PAGE_SIZE</code> has
            been relocated. The buddy system can relocate the allocated
            <span class="quote">“<span class="quote">buddy neighbor</span>”</span> of a freed block when it tries
            to form a bigger freed block. Reading from the table
            <code class="literal">INNODB_CMPMEM_RESET</code> resets this count.</td>
        </tr><tr>
          <td scope="row"><code class="literal">RELOCATION_TIME</code></td>
          <td>Total time in microseconds spent in relocating blocks of the size
            <code class="literal">PAGE_SIZE</code>. Reading from the table
            <code class="literal">INNODB_CMPMEM_RESET</code> resets this count.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_CMPMEM\G</code></strong>
*************************** 1. row ***************************
           page_size: 1024
buffer_pool_instance: 0
          pages_used: 0
          pages_free: 0
      relocation_ops: 0
     relocation_time: 0
*************************** 2. row ***************************
           page_size: 2048
buffer_pool_instance: 0
          pages_used: 0
          pages_free: 0
      relocation_ops: 0
     relocation_time: 0
*************************** 3. row ***************************
           page_size: 4096
buffer_pool_instance: 0
          pages_used: 0
          pages_free: 0
      relocation_ops: 0
     relocation_time: 0
*************************** 4. row ***************************
           page_size: 8192
buffer_pool_instance: 0
          pages_used: 7673
          pages_free: 15
      relocation_ops: 4638
     relocation_time: 0
*************************** 5. row ***************************
           page_size: 16384
buffer_pool_instance: 0
          pages_used: 0
          pages_free: 0
      relocation_ops: 0
     relocation_time: 0
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use these tables to measure the effectiveness of
          <code class="literal">InnoDB</code> table
          <a class="link" href="glossary.html#glos_compression" title="compression">compression</a> in your
          database.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of these tables including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For usage information, see
          <a class="xref" href="innodb-storage-engine.html#innodb-compression-tuning-monitoring" title="14.9.1.4 Monitoring InnoDB Table Compression at Runtime">Section 14.9.1.4, “Monitoring InnoDB Table Compression at Runtime”</a> and
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-examples-compression-sect" title="14.15.1.3 Using the Compression Information Schema Tables">Section 14.15.1.3, “Using the Compression Information Schema Tables”</a>.
          For general information about <code class="literal">InnoDB</code> table
          compression, see <a class="xref" href="innodb-storage-engine.html#innodb-compression" title="14.9 InnoDB Table and Page Compression">Section 14.9, “InnoDB Table and Page Compression”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-cmp-per-index-table"></a>24.31.6 The INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and
INNODB_CMP_PER_INDEX_RESET Tables</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm140710590650320"></a><a class="indexterm" name="idm140710590648864"></a><p>
      The <code class="literal">INNODB_CMP_PER_INDEX</code> and
      <code class="literal">INNODB_CMP_PER_INDEX_RESET</code> tables contain
      status information on operations related to
      <a class="link" href="glossary.html#glos_compression" title="compression">compressed</a>
      <code class="literal">InnoDB</code> tables and indexes, with separate
      statistics for each combination of database, table, and index, to
      help you evaluate the performance and usefulness of compression
      for specific tables.
    </p><p>
      For a compressed <code class="literal">InnoDB</code> table, both the table
      data and all the <a class="link" href="glossary.html#glos_secondary_index" title="secondary index">secondary
      indexes</a> are compressed. In this context, the table data is
      treated as just another index, one that happens to contain all the
      columns: the <a class="link" href="glossary.html#glos_clustered_index" title="clustered index">clustered
      index</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_cmp_per_index_columns_table"></a><p class="title"><b>Table 24.6 Columns of INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_CMP_PER_INDEX and INNODB_CMP_PER_INDEX_RESET tables."><col width="4%"><col width="11%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">DATABASE_NAME</code></td>
          <td>Database containing the applicable table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_NAME</code></td>
          <td>Table to monitor for compression statistics.</td>
        </tr><tr>
          <td scope="row"><code class="literal">INDEX_NAME</code></td>
          <td>Index to monitor for compression statistics.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESS_OPS</code></td>
          <td>Number of compression operations attempted.
            <a class="link" href="glossary.html#glos_page" title="page">Pages</a> are compressed
            whenever an empty page is created or the space for the
            uncompressed modification log runs out.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESS_OPS_OK</code></td>
          <td>Number of successful compression operations. Subtract from the
            <code class="literal">COMPRESS_OPS</code> value to get the number of
            <a class="link" href="glossary.html#glos_compression_failure" title="compression failure">compression
            failures</a>. Divide by the
            <code class="literal">COMPRESS_OPS</code> value to get the percentage
            of compression failures.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMPRESS_TIME</code></td>
          <td>Total amount of CPU time, in seconds, used for compressing data in this
            index.</td>
        </tr><tr>
          <td scope="row"><code class="literal">UNCOMPRESS_OPS</code></td>
          <td>Number of uncompression operations performed. Compressed
            <code class="literal">InnoDB</code> pages are uncompressed whenever
            compression
            <a class="link" href="glossary.html#glos_compression_failure" title="compression failure">fails</a>, or
            the first time a compressed page is accessed in the
            <a class="link" href="glossary.html#glos_buffer_pool" title="buffer pool">buffer pool</a> and the
            uncompressed page does not exist.</td>
        </tr><tr>
          <td scope="row"><code class="literal">UNCOMPRESS_TIME</code></td>
          <td>Total amount of CPU time, in seconds, used for uncompressing data in
            this index.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP_PER_INDEX\G</code></strong>
*************************** 1. row ***************************
  database_name: employees
     table_name: salaries
     index_name: PRIMARY
   compress_ops: 0
compress_ops_ok: 0
  compress_time: 0
 uncompress_ops: 23451
uncompress_time: 4
*************************** 2. row ***************************
  database_name: employees
     table_name: salaries
     index_name: emp_no
   compress_ops: 0
compress_ops_ok: 0
  compress_time: 0
 uncompress_ops: 1597
uncompress_time: 0
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use these tables to measure the effectiveness of
          <code class="literal">InnoDB</code> table
          <a class="link" href="glossary.html#glos_compression" title="compression">compression</a> for
          specific tables, indexes, or both.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of these tables including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query these tables.
        </p></li><li class="listitem"><p>
          Because collecting separate measurements for every index
          imposes substantial performance overhead,
          <code class="literal">INNODB_CMP_PER_INDEX</code> and
          <code class="literal">INNODB_CMP_PER_INDEX_RESET</code> statistics are
          not gathered by default. You must enable the
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_cmp_per_index_enabled"><code class="literal">innodb_cmp_per_index_enabled</code></a>
          configuration option before performing the operations on
          compressed tables that you want to monitor.
        </p></li><li class="listitem"><p>
          For usage information, see
          <a class="xref" href="innodb-storage-engine.html#innodb-compression-tuning-monitoring" title="14.9.1.4 Monitoring InnoDB Table Compression at Runtime">Section 14.9.1.4, “Monitoring InnoDB Table Compression at Runtime”</a> and
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-examples-compression-sect" title="14.15.1.3 Using the Compression Information Schema Tables">Section 14.15.1.3, “Using the Compression Information Schema Tables”</a>.
          For general information about <code class="literal">InnoDB</code> table
          compression, see <a class="xref" href="innodb-storage-engine.html#innodb-compression" title="14.9 InnoDB Table and Page Compression">Section 14.9, “InnoDB Table and Page Compression”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-ft-being-deleted-table"></a>24.31.7 The INFORMATION_SCHEMA INNODB_FT_BEING_DELETED Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590583792"></a><p>
      The <code class="literal">INNODB_FT_BEING_DELETED</code> table is a snapshot
      of the <a class="link" href="information-schema.html#innodb-ft-deleted-table" title="24.31.10 The INFORMATION_SCHEMA INNODB_FT_DELETED Table"><code class="literal">INNODB_FT_DELETED</code></a> table that
      is only used during an <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE
      TABLE</code></a> maintenance operation. When
      <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE TABLE</code></a> is run, the
      <code class="literal">INNODB_FT_BEING_DELETED</code> table is emptied, and
      DOC_IDs are removed from the
      <a class="link" href="information-schema.html#innodb-ft-deleted-table" title="24.31.10 The INFORMATION_SCHEMA INNODB_FT_DELETED Table"><code class="literal">INNODB_FT_DELETED</code></a> table. Because the
      contents of <code class="literal">INNODB_FT_BEING_DELETED</code> typically
      have a short lifetime, this table has limited utility for
      monitoring or debugging. For information about running
      <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE TABLE</code></a> on tables with
      <code class="literal">FULLTEXT</code> indexes, see
      <a class="xref" href="functions.html#fulltext-fine-tuning" title="12.9.6 Fine-Tuning MySQL Full-Text Search">Section 12.9.6, “Fine-Tuning MySQL Full-Text Search”</a>.
    </p><p>
      This table initially appears empty, until you set the value of the
      configuration variable
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a>. The output
      appears similar to the example provided for the
      <a class="link" href="information-schema.html#innodb-ft-deleted-table" title="24.31.10 The INFORMATION_SCHEMA INNODB_FT_DELETED Table"><code class="literal">INNODB_FT_DELETED</code></a> table.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-fulltext_index-tables" title="14.15.4 InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables">Section 14.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_ft_being_deleted_columns_table"></a><p class="title"><b>Table 24.7 INNODB_FT_BEING_DELETED Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_FT_BEING_DELETED table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">DOC_ID</code></td>
          <td>The document ID of the row that is in the process of being deleted. This
            value might reflect the value of an ID column that you
            defined for the underlying table, or it can be a sequence
            value generated by <code class="literal">InnoDB</code> when the table
            does not contain a suitable column. This value is used to
            skip rows in the
            <a class="link" href="information-schema.html#innodb-ft-index-table-table" title="24.31.12 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table"><code class="literal">innodb_ft_index_table</code></a> table,
            when you do text searches before data for deleted rows is
            physically removed from the <code class="literal">FULLTEXT</code>
            index by an <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE TABLE</code></a>
            statement. See <a class="xref" href="functions.html#fulltext-optimize" title="Optimizing InnoDB Full-Text Indexes">Optimizing InnoDB Full-Text Indexes</a> for more
            information.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For more information about <code class="literal">InnoDB</code>
          <code class="literal">FULLTEXT</code> search, see
          <a class="xref" href="innodb-storage-engine.html#innodb-fulltext-index" title="14.8.2.4 InnoDB FULLTEXT Indexes">Section 14.8.2.4, “InnoDB FULLTEXT Indexes”</a>, and
          <a class="xref" href="functions.html#fulltext-search" title="12.9 Full-Text Search Functions">Section 12.9, “Full-Text Search Functions”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-ft-config-table"></a>24.31.8 The INFORMATION_SCHEMA INNODB_FT_CONFIG Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590541424"></a><p>
      The <code class="literal">INNODB_FT_CONFIG</code> table displays metadata
      about the <code class="literal">FULLTEXT</code> index and associated
      processing for an <code class="literal">InnoDB</code> table.
    </p><p>
      Before you query this table, set the configuration variable
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a> to the name
      (including the database name) of the table that contains the
      <code class="literal">FULLTEXT</code> index, for example
      <code class="literal">test/articles</code>.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-fulltext_index-tables" title="14.15.4 InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables">Section 14.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_ft_config_columns_table"></a><p class="title"><b>Table 24.8 INNODB_FT_CONFIG Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_FT_CONFIG table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">KEY</code></td>
          <td>The name designating an item of metadata for an
            <code class="literal">InnoDB</code> table containing a
            <code class="literal">FULLTEXT</code> index.</td>
        </tr><tr>
          <td scope="row"><code class="literal">VALUE</code></td>
          <td>The value associated with the corresponding <code class="literal">KEY</code>
            column, reflecting some limit or current value for an aspect
            of a <code class="literal">FULLTEXT</code> index for an
            <code class="literal">InnoDB</code> table.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;</code></strong>
+---------------------------+-------------------+
| KEY                       | VALUE             |
+---------------------------+-------------------+
| optimize_checkpoint_limit | 180               |
| synced_doc_id             | 0                 |
| stopword_table_name       | test/my_stopwords |
| use_stopword              | 1                 |
+---------------------------+-------------------+
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table is only intended for internal configuration. It is
          not intended for statistical information purposes.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          The values for the <code class="literal">KEY</code> column might evolve
          depending on the needs for performance tuning and debugging
          for <code class="literal">InnoDB</code> full-text processing. The key
          values include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              <code class="literal">optimize_checkpoint_limit</code>: The number
              of seconds after which an <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE
              TABLE</code></a> run will stop.
            </p></li><li class="listitem"><p>
              <code class="literal">synced_doc_id</code>: The next
              <code class="literal">DOC_ID</code> to be issued.
            </p></li><li class="listitem"><p>
              <code class="literal">stopword_table_name</code>: The
              <em class="replaceable"><code>database/table</code></em> name for a user
              defined stopword table. This field appears empty if there
              is no user-defined stopword table.
            </p></li><li class="listitem"><p>
              <code class="literal">use_stopword</code>: Indicates whether or not
              a stopword table is used, which is defined when the
              <code class="literal">FULLTEXT</code> index is created.
</p></li></ul>
</div>
</li><li class="listitem"><p>
          For more information about <code class="literal">InnoDB</code>
          <code class="literal">FULLTEXT</code> search, see
          <a class="xref" href="innodb-storage-engine.html#innodb-fulltext-index" title="14.8.2.4 InnoDB FULLTEXT Indexes">Section 14.8.2.4, “InnoDB FULLTEXT Indexes”</a>, and
          <a class="xref" href="functions.html#fulltext-search" title="12.9 Full-Text Search Functions">Section 12.9, “Full-Text Search Functions”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-ft-default-stopword-table"></a>24.31.9 The INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590488752"></a><p>
      The <code class="literal">INNODB_FT_DEFAULT_STOPWORD</code> table holds a
      list of <a class="link" href="glossary.html#glos_stopword" title="stopword">stopwords</a> that are
      used by default when creating a <code class="literal">FULLTEXT</code> index
      on an <code class="literal">InnoDB</code> table. For information about the
      default <code class="literal">InnoDB</code> stopword list and how to define
      your own stopword lists, see <a class="xref" href="functions.html#fulltext-stopwords" title="12.9.4 Full-Text Stopwords">Section 12.9.4, “Full-Text Stopwords”</a>.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-fulltext_index-tables" title="14.15.4 InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables">Section 14.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_ft_default_stopword_columns_table"></a><p class="title"><b>Table 24.9 INNODB_FT_DEFAULT_STOPWORD Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_FT_DEFAULT_STOPWORD table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">value</code></td>
          <td>A word that is used by default as a stopword for
            <code class="literal">FULLTEXT</code> indexes on
            <code class="literal">InnoDB</code> tables. Not used if you override
            the default stopword processing with either the
            <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_server_stopword_table"><code class="literal">innodb_ft_server_stopword_table</code></a>
            or the
            <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_user_stopword_table"><code class="literal">innodb_ft_user_stopword_table</code></a>
            option.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD;</code></strong>
+-------+
| value |
+-------+
| a     |
| about |
| an    |
| are   |
| as    |
| at    |
| be    |
| by    |
| com   |
| de    |
| en    |
| for   |
| from  |
| how   |
| i     |
| in    |
| is    |
| it    |
| la    |
| of    |
| on    |
| or    |
| that  |
| the   |
| this  |
| to    |
| was   |
| what  |
| when  |
| where |
| who   |
| will  |
| with  |
| und   |
| the   |
| www   |
+-------+
36 rows in set (0.00 sec)
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For more information about <code class="literal">InnoDB</code>
          <code class="literal">FULLTEXT</code> search, see
          <a class="xref" href="innodb-storage-engine.html#innodb-fulltext-index" title="14.8.2.4 InnoDB FULLTEXT Indexes">Section 14.8.2.4, “InnoDB FULLTEXT Indexes”</a>, and
          <a class="xref" href="functions.html#fulltext-search" title="12.9 Full-Text Search Functions">Section 12.9, “Full-Text Search Functions”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-ft-deleted-table"></a>24.31.10 The INFORMATION_SCHEMA INNODB_FT_DELETED Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590452576"></a><p>
      The <code class="literal">INNODB_FT_DELETED</code> table records rows that
      are deleted from the <code class="literal">FULLTEXT</code> index for an
      <code class="literal">InnoDB</code> table. To avoid expensive index
      reorganization during DML operations for an
      <code class="literal">InnoDB</code> <code class="literal">FULLTEXT</code> index, the
      information about newly deleted words is stored separately,
      filtered out of search results when you do a text search, and
      removed from the main search index only when you issue the
      <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE TABLE</code></a> statement for the
      <code class="literal">InnoDB</code> table. See
      <a class="xref" href="functions.html#fulltext-optimize" title="Optimizing InnoDB Full-Text Indexes">Optimizing InnoDB Full-Text Indexes</a> for more information.
    </p><p>
      This table initially appears empty, until you set the value of the
      configuration variable
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a> to the name
      (including the database name) of the table that contains the
      <code class="literal">FULLTEXT</code> index, for example
      <code class="literal">test/articles</code>.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-fulltext_index-tables" title="14.15.4 InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables">Section 14.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_ft_deleted_columns_table"></a><p class="title"><b>Table 24.10 INNODB_FT_DELETED Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_FT_DELETED table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">DOC_ID</code></td>
          <td>The document ID of the newly deleted row. This value might reflect the
            value of an ID column that you defined for the underlying
            table, or it can be a sequence value generated by
            <code class="literal">InnoDB</code> when the table does not contain a
            suitable column. This value is used to skip rows in the
            <a class="link" href="information-schema.html#innodb-ft-index-table-table" title="24.31.12 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table"><code class="literal">innodb_ft_index_table</code></a> table,
            when you do text searches before data for deleted rows is
            physically removed from the <code class="literal">FULLTEXT</code>
            index by an <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE TABLE</code></a>
            statement. See <a class="xref" href="functions.html#fulltext-optimize" title="Optimizing InnoDB Full-Text Indexes">Optimizing InnoDB Full-Text Indexes</a> for more
            information.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;</code></strong>
+--------+
| DOC_ID |
+--------+
|      6 |
|      7 |
|      8 |
+--------+
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For more information about <code class="literal">InnoDB</code>
          <code class="literal">FULLTEXT</code> search, see
          <a class="xref" href="innodb-storage-engine.html#innodb-fulltext-index" title="14.8.2.4 InnoDB FULLTEXT Indexes">Section 14.8.2.4, “InnoDB FULLTEXT Indexes”</a>, and
          <a class="xref" href="functions.html#fulltext-search" title="12.9 Full-Text Search Functions">Section 12.9, “Full-Text Search Functions”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-ft-index-cache-table"></a>24.31.11 The INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590410544"></a><p>
      <code class="literal">INNODB_FT_INDEX_CACHE</code>: Contains token
      information about newly inserted rows in a
      <code class="literal">FULLTEXT</code> index. To avoid expensive index
      reorganization during DML operations, the information about newly
      indexed words is stored separately, and combined with the main
      search index only when <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE
      TABLE</code></a> is run, when the server is shut down, or when the
      cache size exceeds a limit defined by
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_cache_size"><code class="literal">innodb_ft_cache_size</code></a> or
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_total_cache_size"><code class="literal">innodb_ft_total_cache_size</code></a>.
    </p><p>
      Before you query this table, set the configuration variable
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a> to the name
      (including the database name) of the table that contains the
      <code class="literal">FULLTEXT</code> index, for example
      <code class="literal">test/articles</code>.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-fulltext_index-tables" title="14.15.4 InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables">Section 14.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_ft_index_cache_columns_table"></a><p class="title"><b>Table 24.11 INNODB_FT_INDEX_CACHE Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_FT_INDEX_CACHE table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">WORD</code></td>
          <td>A word extracted from the text of a newly inserted row.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FIRST_DOC_ID</code></td>
          <td>The first document ID that this word appears in the
            <code class="literal">FULLTEXT</code> index.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LAST_DOC_ID</code></td>
          <td>The last document ID that this word appears in the
            <code class="literal">FULLTEXT</code> index.</td>
        </tr><tr>
          <td scope="row"><code class="literal">DOC_COUNT</code></td>
          <td>The number of rows this word appears in the <code class="literal">FULLTEXT</code>
            index. The same word can occur several times within the
            cache table, once for each combination of
            <code class="literal">DOC_ID</code> and <code class="literal">POSITION</code>
            values.</td>
        </tr><tr>
          <td scope="row"><code class="literal">DOC_ID</code></td>
          <td>The document ID of the newly inserted row. This value might reflect the
            value of an ID column that you defined for the underlying
            table, or it can be a sequence value generated by
            <code class="literal">InnoDB</code> when the table does not contain a
            suitable column.</td>
        </tr><tr>
          <td scope="row"><code class="literal">POSITION</code></td>
          <td>The position of this particular instance of the word within the relevant
            document identified by the <code class="literal">DOC_ID</code> value.
            The value does not represent an absolute position; it is an
            offset added to the <code class="literal">POSITION</code> of the
            previous instance of that word.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table initially appears empty, until you set the value of
          the configuration variable
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a>. The
          following example demonstrates how to use the
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a> option to
          show information about a <code class="literal">FULLTEXT</code> index for
          a specified table.
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>USE test;</code></strong>

mysql&gt; <strong class="userinput"><code>CREATE TABLE articles (
      id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
      title VARCHAR(200),
      body TEXT,
      FULLTEXT (title,body)
    ) ENGINE=InnoDB;</code></strong>

mysql&gt; <strong class="userinput"><code>INSERT INTO articles (title,body) VALUES
    ('MySQL Tutorial','DBMS stands for DataBase ...'),
    ('How To Use MySQL Well','After you went through a ...'),
    ('Optimizing MySQL','In this tutorial we will show ...'),
    ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
    ('MySQL vs. YourSQL','In the following database comparison ...'),
    ('MySQL Security','When configured properly, MySQL ...');</code></strong>

mysql&gt; <strong class="userinput"><code>SET GLOBAL innodb_ft_aux_table = 'test/articles';</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>USE INFORMATION_SCHEMA;</code></strong>

mysql&gt; <strong class="userinput"><code>SELECT word, doc_count, doc_id, position FROM INNODB_FT_INDEX_CACHE LIMIT 5;</code></strong>
+------------+-----------+--------+----------+
| word       | doc_count | doc_id | position |
+------------+-----------+--------+----------+
| 1001       |         1 |      4 |        0 |
| after      |         1 |      2 |       22 |
| comparison |         1 |      5 |       44 |
| configured |         1 |      6 |       20 |
| database   |         2 |      1 |       31 |
+------------+-----------+--------+----------+
</pre></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For more information about <code class="literal">InnoDB</code>
          <code class="literal">FULLTEXT</code> search, see
          <a class="xref" href="innodb-storage-engine.html#innodb-fulltext-index" title="14.8.2.4 InnoDB FULLTEXT Indexes">Section 14.8.2.4, “InnoDB FULLTEXT Indexes”</a>, and
          <a class="xref" href="functions.html#fulltext-search" title="12.9 Full-Text Search Functions">Section 12.9, “Full-Text Search Functions”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-ft-index-table-table"></a>24.31.12 The INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590346240"></a><p>
      The <code class="literal">INNODB_FT_INDEX_TABLE</code> table displays
      information about the inverted index used to process text searches
      against the <code class="literal">FULLTEXT</code> index of an
      <code class="literal">InnoDB</code> table.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-fulltext_index-tables" title="14.15.4 InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables">Section 14.15.4, “InnoDB INFORMATION_SCHEMA FULLTEXT Index Tables”</a>.
    </p><p>
      Before you query this table, set the configuration variable
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a> to the name
      (including the database name) of the table that contains the
      <code class="literal">FULLTEXT</code> index, for example
      <code class="literal">test/articles</code>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_ft_index_table_columns_table"></a><p class="title"><b>Table 24.12 INNODB_FT_INDEX_TABLE Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_FT_INDEX_TABLE table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">WORD</code></td>
          <td>A word extracted from the text of the columns that are part of a
            <code class="literal">FULLTEXT</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FIRST_DOC_ID</code></td>
          <td>The first document ID that this word appears in the
            <code class="literal">FULLTEXT</code> index.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LAST_DOC_ID</code></td>
          <td>The last document ID that this word appears in the
            <code class="literal">FULLTEXT</code> index.</td>
        </tr><tr>
          <td scope="row"><code class="literal">DOC_COUNT</code></td>
          <td>The number of rows this word appears in the <code class="literal">FULLTEXT</code>
            index. The same word can occur several times within the
            cache table, once for each combination of
            <code class="literal">DOC_ID</code> and <code class="literal">POSITION</code>
            values.</td>
        </tr><tr>
          <td scope="row"><code class="literal">DOC_ID</code></td>
          <td>The document ID of the row containing the word. This value might reflect
            the value of an ID column that you defined for the
            underlying table, or it can be a sequence value generated by
            <code class="literal">InnoDB</code> when the table does not contain a
            suitable column.</td>
        </tr><tr>
          <td scope="row"><code class="literal">POSITION</code></td>
          <td>The position of this particular instance of the word within the relevant
            document identified by the <code class="literal">DOC_ID</code> value.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table initially appears empty, until you set the value of
          the configuration variable
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a>. The
          following example demonstrates how to use the
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_ft_aux_table"><code class="literal">innodb_ft_aux_table</code></a> option to
          show information about a <code class="literal">FULLTEXT</code> index for
          a specified table. Before information for newly inserted rows
          appears in <code class="literal">INNODB_FT_INDEX_TABLE</code>, the
          <code class="literal">FULLTEXT</code> index cache must be flushed to
          disk. This is accomplished by running an
          <a class="link" href="sql-syntax.html#optimize-table" title="13.7.2.4 OPTIMIZE TABLE Syntax"><code class="literal">OPTIMIZE TABLE</code></a> operation on the
          indexed table with
          <a class="link" href="innodb-storage-engine.html#sysvar_innodb_optimize_fulltext_only"><code class="literal">innodb_optimize_fulltext_only=ON</code></a>.
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>USE test;</code></strong>

mysql&gt; <strong class="userinput"><code>CREATE TABLE articles (
      id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
      title VARCHAR(200),
      body TEXT,
      FULLTEXT (title,body)
    ) ENGINE=InnoDB;</code></strong>

mysql&gt; <strong class="userinput"><code>INSERT INTO articles (title,body) VALUES
    ('MySQL Tutorial','DBMS stands for DataBase ...'),
    ('How To Use MySQL Well','After you went through a ...'),
    ('Optimizing MySQL','In this tutorial we will show ...'),
    ('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
    ('MySQL vs. YourSQL','In the following database comparison ...'),
    ('MySQL Security','When configured properly, MySQL ...');</code></strong>

mysql&gt; <strong class="userinput"><code>SET GLOBAL innodb_optimize_fulltext_only=ON;</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>OPTIMIZE TABLE articles;</code></strong>
+---------------+----------+----------+----------+
| Table         | Op       | Msg_type | Msg_text |
+---------------+----------+----------+----------+
| test.articles | optimize | status   | OK       |
+---------------+----------+----------+----------+

mysql&gt; <strong class="userinput"><code>SET GLOBAL innodb_ft_aux_table = 'test/articles';</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>USE INFORMATION_SCHEMA;</code></strong>

mysql&gt; <strong class="userinput"><code>SELECT word, doc_count, doc_id, position FROM INNODB_FT_INDEX_TABLE LIMIT 5;</code></strong>
+------------+-----------+--------+----------+
| word       | doc_count | doc_id | position |
+------------+-----------+--------+----------+
| 1001       |         1 |      4 |        0 |
| after      |         1 |      2 |       22 |
| comparison |         1 |      5 |       44 |
| configured |         1 |      6 |       20 |
| database   |         2 |      1 |       31 |
+------------+-----------+--------+----------+
</pre></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For more information about <code class="literal">InnoDB</code>
          <code class="literal">FULLTEXT</code> search, see
          <a class="xref" href="innodb-storage-engine.html#innodb-fulltext-index" title="14.8.2.4 InnoDB FULLTEXT Indexes">Section 14.8.2.4, “InnoDB FULLTEXT Indexes”</a>, and
          <a class="xref" href="functions.html#fulltext-search" title="12.9 Full-Text Search Functions">Section 12.9, “Full-Text Search Functions”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-locks-table"></a>24.31.13 The INFORMATION_SCHEMA INNODB_LOCKS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590279168"></a><p>
      The <code class="literal">INNODB_LOCKS</code> table contains information
      about each lock that an <code class="literal">InnoDB</code> transaction has
      requested but not yet acquired, and each lock that a transaction
      holds that is blocking another transaction.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        This table is deprecated as of MySQL 5.7.14 and is removed in
        MySQL 8.0.
</p>
</div>

<div class="table">
<a name="innodb-information-schema-innodb_locks_columns_table"></a><p class="title"><b>Table 24.13 INNODB_LOCKS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_LOCKS table."><col width="1%"><col width="4%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">LOCK_ID</code></td>
          <td>Unique lock ID number, internal to <code class="literal">InnoDB</code>. Treat it
            as an opaque string. Although <code class="literal">LOCK_ID</code>
            currently contains <code class="literal">TRX_ID</code>, the format of
            the data in <code class="literal">LOCK_ID</code> is subject to change
            at any time. Do not write applications that parse the
            <code class="literal">LOCK_ID</code> value.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_TRX_ID</code></td>
          <td>ID of the transaction holding the lock. To obtain details about the
            transaction, join this column with the
            <code class="literal">TRX_ID</code> column of the
            <a class="link" href="information-schema.html#innodb-trx-table" title="24.31.27 The INFORMATION_SCHEMA INNODB_TRX Table"><code class="literal">INNODB_TRX</code></a> table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_MODE</code></td>
          <td>How the lock is requested. Permitted values are
            <code class="literal">S[,GAP]</code>, <code class="literal">X[,GAP]</code>,
            <code class="literal">IS[,GAP]</code>, <code class="literal">IX[,GAP]</code>,
            <code class="literal">AUTO_INC</code>, and <code class="literal">UNKNOWN</code>.
            Lock modes other than <code class="literal">AUTO_INC</code> and
            <code class="literal">UNKNOWN</code> indicate gap locks, if present.
            For information about <code class="literal">S</code>,
            <code class="literal">X</code>, <code class="literal">IS</code>,
            <code class="literal">IX</code>, and gap locks, refer to
            <a class="xref" href="innodb-storage-engine.html#innodb-locking" title="14.5.1 InnoDB Locking">Section 14.5.1, “InnoDB Locking”</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_TYPE</code></td>
          <td>The type of lock. Permitted values are <code class="literal">RECORD</code> for a
            row-level lock, <code class="literal">TABLE</code> for a table-level
            lock.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_TABLE</code></td>
          <td>Name of the table that has been locked or contains locked records.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_INDEX</code></td>
          <td>Name of the index, if <code class="literal">LOCK_TYPE</code> is
            <code class="literal">RECORD</code>; otherwise
            <code class="literal">NULL</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_SPACE</code></td>
          <td>Tablespace ID of the locked record, if <code class="literal">LOCK_TYPE</code> is
            <code class="literal">RECORD</code>; otherwise
            <code class="literal">NULL</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_PAGE</code></td>
          <td>Page number of the locked record, if <code class="literal">LOCK_TYPE</code> is
            <code class="literal">RECORD</code>; otherwise
            <code class="literal">NULL</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_REC</code></td>
          <td>Heap number of the locked record within the page, if
            <code class="literal">LOCK_TYPE</code> is <code class="literal">RECORD</code>;
            otherwise <code class="literal">NULL</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LOCK_DATA</code></td>
          <td>The data associated with the lock, if any. Values are primary key values
            of the locked record if <code class="literal">LOCK_TYPE</code> is
            <code class="literal">RECORD</code>, otherwise
            <code class="literal">NULL</code>. This column contains the values of
            the primary key columns in the locked row, formatted as a
            valid SQL string (ready to be copied to SQL statements). If
            there is no primary key, <code class="literal">LOCK_DATA</code> is the
            unique <code class="literal">InnoDB</code> internal row ID number. If
            a gap lock is taken for key values or ranges above the
            largest value in the index, <code class="literal">LOCK_DATA</code>
            reports <code class="literal">supremum pseudo-record</code>. When the
            page containing the locked record is not in the buffer pool
            (in the case that it was paged out to disk while the lock
            was held), <code class="literal">InnoDB</code> does not fetch the page
            from disk, to avoid unnecessary disk operations. Instead,
            <code class="literal">LOCK_DATA</code> is set to
            <code class="literal">NULL</code>.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS\G</code></strong>
*************************** 1. row ***************************
    lock_id: 3723:72:3:2
lock_trx_id: 3723
  lock_mode: X
  lock_type: RECORD
 lock_table: `mysql`.`t`
 lock_index: PRIMARY
 lock_space: 72
  lock_page: 3
   lock_rec: 2
  lock_data: 1, 9
*************************** 2. row ***************************
    lock_id: 3722:72:3:2
lock_trx_id: 3722
  lock_mode: S
  lock_type: RECORD
 lock_table: `mysql`.`t`
 lock_index: PRIMARY
 lock_space: 72
  lock_page: 3
   lock_rec: 2
  lock_data: 1, 9
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use this table to help diagnose performance problems that
          occur during times of heavy concurrent load. Its contents are
          updated as described in
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-internal-data" title="14.15.2.3 Persistence and Consistency of InnoDB Transaction and Locking Information">Section 14.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking
        Information”</a>.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For usage information, see
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-examples" title="14.15.2.1 Using InnoDB Transaction and Locking Information">Section 14.15.2.1, “Using InnoDB Transaction and Locking Information”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-lock-waits-table"></a>24.31.14 The INFORMATION_SCHEMA INNODB_LOCK_WAITS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590192144"></a><p>
      The <code class="literal">INNODB_LOCK_WAITS</code> table contains one or
      more rows for each blocked <code class="literal">InnoDB</code> transaction,
      indicating the lock it has requested and any locks that are
      blocking that request.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        This table is deprecated as of MySQL 5.7.14 and is removed in
        MySQL 8.0.
</p>
</div>

<div class="table">
<a name="innodb-information-schema-innodb_lock_waits_columns_table"></a><p class="title"><b>Table 24.14 INNODB_LOCK_WAITS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_LOCK_WAITS table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">REQUESTING_TRX_ID</code></td>
          <td>ID of the requesting (blocked) transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">REQUESTED_LOCK_ID</code></td>
          <td>ID of the lock for which a transaction is waiting. To obtain details
            about the lock, join this column with the
            <code class="literal">LOCK_ID</code> column of the
            <a class="link" href="information-schema.html#innodb-locks-table" title="24.31.13 The INFORMATION_SCHEMA INNODB_LOCKS Table"><code class="literal">INNODB_LOCKS</code></a> table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">BLOCKING_TRX_ID</code></td>
          <td>ID of the blocking transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">BLOCKING_LOCK_ID</code></td>
          <td>ID of a lock held by a transaction blocking another transaction from
            proceeding. To obtain details about the lock, join this
            column with the <code class="literal">LOCK_ID</code> column of the
            <a class="link" href="information-schema.html#innodb-locks-table" title="24.31.13 The INFORMATION_SCHEMA INNODB_LOCKS Table"><code class="literal">INNODB_LOCKS</code></a> table.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS\G</code></strong>
*************************** 1. row ***************************
requesting_trx_id: 3396
requested_lock_id: 3396:91:3:2
  blocking_trx_id: 3395
 blocking_lock_id: 3395:91:3:2
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use this table to help diagnose performance problems that
          occur during times of heavy concurrent load. Its contents are
          updated as described in
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-internal-data" title="14.15.2.3 Persistence and Consistency of InnoDB Transaction and Locking Information">Section 14.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking
        Information”</a>.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For usage information, see
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-examples" title="14.15.2.1 Using InnoDB Transaction and Locking Information">Section 14.15.2.1, “Using InnoDB Transaction and Locking Information”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-metrics-table"></a>24.31.15 The INFORMATION_SCHEMA INNODB_METRICS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590151408"></a><p>
      This <code class="literal">INFORMATION_SCHEMA</code> table presents a wide
      variety of <code class="literal">InnoDB</code> performance information,
      complementing the specific focus areas of the
      <code class="literal">PERFORMANCE_SCHEMA</code> tables for
      <code class="literal">InnoDB</code>. With simple queries, you can check the
      overall health of the system. With more detailed queries, you can
      diagnose issues such as performance bottlenecks, resource
      shortages, and application issues.
    </p><p>
      Each monitor represents a point within the
      <code class="literal">InnoDB</code> source code that is instrumented to
      gather counter information. Each counter can be started, stopped,
      and reset. You can also perform these actions for a group of
      counters using their common module name.
    </p><p>
      By default, relatively little data is collected. To start, stop,
      and reset counters, you set one of the configuration options
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_monitor_enable"><code class="literal">innodb_monitor_enable</code></a>,
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_monitor_disable"><code class="literal">innodb_monitor_disable</code></a>,
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_monitor_reset"><code class="literal">innodb_monitor_reset</code></a>, or
      <a class="link" href="innodb-storage-engine.html#sysvar_innodb_monitor_reset_all"><code class="literal">innodb_monitor_reset_all</code></a>, using
      the name of the counter, the name of the module, a wildcard match
      for such a name using the <span class="quote">“<span class="quote">%</span>”</span> character, or the
      special keyword <code class="literal">all</code>.
    </p><p>
      For usage information, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-metrics-table" title="14.15.6 InnoDB INFORMATION_SCHEMA Metrics Table">Section 14.15.6, “InnoDB INFORMATION_SCHEMA Metrics Table”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_metrics_table"></a><p class="title"><b>Table 24.15 INNODB_METRICS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_METRICS table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>Unique name for the counter.</td>
        </tr><tr>
          <td scope="row"><code class="literal">SUBSYSTEM</code></td>
          <td>The aspect of <code class="literal">InnoDB</code> that the metric applies to. See
            the list following the table for the corresponding module
            names to use with the <code class="literal">SET GLOBAL</code> syntax.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COUNT</code></td>
          <td>Value since the counter is enabled.</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAX_COUNT</code></td>
          <td>Maximum value since the counter is enabled.</td>
        </tr><tr>
          <td scope="row"><code class="literal">MIN_COUNT</code></td>
          <td>Minimum value since the counter is enabled.</td>
        </tr><tr>
          <td scope="row"><code class="literal">AVG_COUNT</code></td>
          <td>Average value since the counter is enabled.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COUNT_RESET</code></td>
          <td>Counter value since it was last reset. (The <code class="literal">_RESET</code>
            fields act like the lap counter on a stopwatch: you can
            measure the activity during some time interval, while the
            cumulative figures are still available in the
            <code class="literal">COUNT</code>, <code class="literal">MAX_COUNT</code>, and
            so on fields.)</td>
        </tr><tr>
          <td scope="row"><code class="literal">MAX_COUNT_RESET</code></td>
          <td>Maximum counter value since it was last reset.</td>
        </tr><tr>
          <td scope="row"><code class="literal">MIN_COUNT_RESET</code></td>
          <td>Minimum counter value since it was last reset.</td>
        </tr><tr>
          <td scope="row"><code class="literal">AVG_COUNT_RESET</code></td>
          <td>Average counter value since it was last reset.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TIME_ENABLED</code></td>
          <td>Timestamp of last start.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TIME_DISABLED</code></td>
          <td>Timestamp of last stop.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TIME_ELAPSED</code></td>
          <td>Elapsed time in seconds since the counter started.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TIME_RESET</code></td>
          <td>Timestamp of last stop.</td>
        </tr><tr>
          <td scope="row"><code class="literal">STATUS</code></td>
          <td>Whether the counter is still running (<code class="literal">enabled</code>) or
            stopped (<code class="literal">disabled</code>).</td>
        </tr><tr>
          <td scope="row"><code class="literal">TYPE</code></td>
          <td>Whether the item is a cumulative counter, or measures the current value
            of some resource.</td>
        </tr><tr>
          <td scope="row"><code class="literal">COMMENT</code></td>
          <td>Counter description.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME="dml_inserts"\G</code></strong>
*************************** 1. row ***************************
           NAME: dml_inserts
      SUBSYSTEM: dml
          COUNT: 3
      MAX_COUNT: 3
      MIN_COUNT: NULL
      AVG_COUNT: 0.046153846153846156
    COUNT_RESET: 3
MAX_COUNT_RESET: 3
MIN_COUNT_RESET: NULL
AVG_COUNT_RESET: NULL
   TIME_ENABLED: 2014-12-04 14:18:28
  TIME_DISABLED: NULL
   TIME_ELAPSED: 65
     TIME_RESET: NULL
         STATUS: enabled
           TYPE: status_counter
        COMMENT: Number of rows inserted
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-columns-table"></a>24.31.16 The INFORMATION_SCHEMA INNODB_SYS_COLUMNS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590065392"></a><p>
      The <code class="literal">INNODB_SYS_COLUMNS</code> table provides metadata
      about <code class="literal">InnoDB</code> table columns, equivalent to the
      information from the <code class="literal">SYS_COLUMNS</code> table in the
      <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_columns_columns_table"></a><p class="title"><b>Table 24.16 INNODB_SYS_COLUMNS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_COLUMNS table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_ID</code></td>
          <td>An identifier representing the table associated with the column; the
            same value from
            <code class="literal">INNODB_SYS_TABLES.TABLE_ID</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>The name of each column in each table. These names can be uppercase or
            lowercase depending on the
            <a class="link" href="server-administration.html#sysvar_lower_case_table_names"><code class="literal">lower_case_table_names</code></a>
            setting. There are no special system-reserved names for
            columns.</td>
        </tr><tr>
          <td scope="row"><code class="literal">POS</code></td>
          <td>The ordinal position of the column within the table, starting from 0 and
            incrementing sequentially. When a column is dropped, the
            remaining columns are reordered so that the sequence has no
            gaps. The <code class="literal">POS</code> value for a virtual
            generated column encodes the column sequence number and
            ordinal position of the column. For more information, see
            the <code class="literal">POS</code> column description in
            <a class="xref" href="information-schema.html#innodb-sys-virtual-table" title="24.31.25 The INFORMATION_SCHEMA INNODB_SYS_VIRTUAL Table">Section 24.31.25, “The INFORMATION_SCHEMA INNODB_SYS_VIRTUAL Table”</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">MTYPE</code></td>
          <td>Stands for <span class="quote">“<span class="quote">main type</span>”</span>. A numeric identifier for the column
            type. 1 = <code class="literal">VARCHAR</code>, 2 =
            <code class="literal">CHAR</code>, 3 = <code class="literal">FIXBINARY</code>, 4
            = <code class="literal">BINARY</code>, 5 = <code class="literal">BLOB</code>, 6
            = <code class="literal">INT</code>, 7 = <code class="literal">SYS_CHILD</code>,
            8 = <code class="literal">SYS</code>, 9 = <code class="literal">FLOAT</code>, 10
            = <code class="literal">DOUBLE</code>, 11 =
            <code class="literal">DECIMAL</code>, 12 =
            <code class="literal">VARMYSQL</code>, 13 = <code class="literal">MYSQL</code>,
            14 = <code class="literal">GEOMETRY</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PRTYPE</code></td>
          <td>The <code class="literal">InnoDB</code> <span class="quote">“<span class="quote">precise type</span>”</span>, a binary
            value with bits representing MySQL data type, character set
            code, and nullability.</td>
        </tr><tr>
          <td scope="row"><code class="literal">LEN</code></td>
          <td>The column length, for example 4 for <code class="literal">INT</code> and 8 for
            <code class="literal">BIGINT</code>. For character columns in
            multibyte character sets, this length value is the maximum
            length in bytes needed to represent a definition such as
            <code class="literal">VARCHAR(<em class="replaceable"><code>N</code></em>)</code>;
            that is, it might be
            <code class="literal">2*<em class="replaceable"><code>N</code></em></code>,
            <code class="literal">3*<em class="replaceable"><code>N</code></em></code>, and so on
            depending on the character encoding.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS where TABLE_ID = 71\G</code></strong>
*************************** 1. row ***************************
TABLE_ID: 71
    NAME: col1
     POS: 0
   MTYPE: 6
  PRTYPE: 1027
     LEN: 4
*************************** 2. row ***************************
TABLE_ID: 71
    NAME: col2
     POS: 1
   MTYPE: 2
  PRTYPE: 524542
     LEN: 10
*************************** 3. row ***************************
TABLE_ID: 71
    NAME: col3
     POS: 2
   MTYPE: 1
  PRTYPE: 524303
     LEN: 10
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-datafiles-table"></a>24.31.17 The INFORMATION_SCHEMA INNODB_SYS_DATAFILES Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710590003168"></a><p>
      The <code class="literal">INNODB_SYS_DATAFILES</code> table provides data
      file path information for <code class="literal">InnoDB</code> file-per-table
      and general tablespaces, equivalent to the information in the
      <code class="literal">SYS_DATAFILES</code> table in the
      <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        The <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a> table
        reports metadata for all <code class="literal">InnoDB</code> tablespace
        types including file-per-table tablespaces, general tablespaces,
        the system tablespace, the temporary tablespace, and undo
        tablespaces, if present.
</p>
</div>

<div class="table">
<a name="innodb-information-schema-innodb_sys_datafiles_columns_table"></a><p class="title"><b>Table 24.17 INNODB_SYS_DATAFILES Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_DATAFILES table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">SPACE</code></td>
          <td>The tablespace Space ID.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PATH</code></td>
          <td>The tablespace data file path. If a
            <a class="link" href="glossary.html#glos_file_per_table" title="file-per-table">file-per-table</a>
            tablespace is created in a location outside the MySQL data
            directory, the path value is a fully qualified directory
            path.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE SPACE = 57\G</code></strong>
*************************** 1. row ***************************
SPACE: 57
 PATH: ./test/t1.ibd
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-fields-table"></a>24.31.18 The INFORMATION_SCHEMA INNODB_SYS_FIELDS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589969824"></a><p>
      The <code class="literal">INNODB_SYS_FIELDS</code> table provides metadata
      about the key columns (fields) of <code class="literal">InnoDB</code>
      indexes, equivalent to the information from the
      <code class="literal">SYS_FIELDS</code> table in the
      <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_fields_columns_table"></a><p class="title"><b>Table 24.18 INNODB_SYS_FIELDS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_FIELDS table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">INDEX_ID</code></td>
          <td>An identifier for the index associated with this key field, using the
            same value as in
            <code class="literal">INNODB_SYS_INDEXES.INDEX_ID</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>The name of the original column from the table, using the same value as
            in <code class="literal">INNODB_SYS_COLUMNS.NAME</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">POS</code></td>
          <td>The ordinal position of the key field within the index, starting from 0
            and incrementing sequentially. When a column is dropped, the
            remaining columns are reordered so that the sequence has no
            gaps.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID = 117\G</code></strong>
*************************** 1. row ***************************
INDEX_ID: 117
    NAME: col1
     POS: 0
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-foreign-table"></a>24.31.19 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589935920"></a><p>
      The <code class="literal">INNODB_SYS_FOREIGN</code> table provides metadata
      about <code class="literal">InnoDB</code>
      <a class="link" href="glossary.html#glos_foreign_key" title="foreign key">foreign keys</a>, equivalent
      to the information from the <code class="literal">SYS_FOREIGN</code> table
      in the <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_foreign_columns_table"></a><p class="title"><b>Table 24.19 INNODB_SYS_FOREIGN Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_FOREIGN table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">ID</code></td>
          <td>The name (not a numeric value) of the foreign key index. Preceded by the
            database name, for example,
            <code class="literal">test/products_fk</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FOR_NAME</code></td>
          <td>The name of the <a class="link" href="glossary.html#glos_child_table" title="child table">child table</a> in
            this foreign key relationship.</td>
        </tr><tr>
          <td scope="row"><code class="literal">REF_NAME</code></td>
          <td>The name of the <a class="link" href="glossary.html#glos_parent_table" title="parent table">parent table</a> in
            this foreign key relationship.</td>
        </tr><tr>
          <td scope="row"><code class="literal">N_COLS</code></td>
          <td>The number of columns in the foreign key index.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TYPE</code></td>
          <td>A collection of bit flags with information about the foreign key column,
            ORed together. 1 = <code class="literal">ON DELETE CASCADE</code>, 2 =
            <code class="literal">ON UPDATE SET</code> NULL, 4 = <code class="literal">ON
            UPDATE CASCADE</code>, 8 = <code class="literal">ON UPDATE
            SET</code> NULL, 16 = <code class="literal">ON DELETE NO</code>
            ACTION, 32 = <code class="literal">ON UPDATE NO</code> ACTION.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN\G</code></strong>
*************************** 1. row ***************************
      ID: test/fk1
FOR_NAME: test/child
REF_NAME: test/parent
  N_COLS: 1
    TYPE: 1
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-foreign-cols-table"></a>24.31.20 The INFORMATION_SCHEMA INNODB_SYS_FOREIGN_COLS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589890336"></a><p>
      The <code class="literal">INNODB_SYS_FOREIGN_COLS</code> table provides
      status information about the columns of <code class="literal">InnoDB</code>
      foreign keys, equivalent to the information from the
      <code class="literal">SYS_FOREIGN_COLS</code> table in the
      <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_foreign_cols_columns_table"></a><p class="title"><b>Table 24.20 INNODB_SYS_FOREIGN_COLS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_FOREIGN_COLS table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">ID</code></td>
          <td>The foreign key index associated with this index key field, using the
            same value as <code class="literal">INNODB_SYS_FOREIGN.ID</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FOR_COL_NAME</code></td>
          <td>The name of the associated column in the child table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">REF_COL_NAME</code></td>
          <td>The name of the associated column in the parent table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">POS</code></td>
          <td>The ordinal position of this key field within the foreign key index,
            starting from 0.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS WHERE ID = 'test/fk1'\G</code></strong>
*************************** 1. row ***************************
          ID: test/fk1
FOR_COL_NAME: parent_id
REF_COL_NAME: id
         POS: 0
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-indexes-table"></a>24.31.21 The INFORMATION_SCHEMA INNODB_SYS_INDEXES Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589854432"></a><p>
      The <code class="literal">INNODB_SYS_INDEXES</code> table provides metadata
      about <code class="literal">InnoDB</code> indexes, equivalent to the
      information in the internal <code class="literal">SYS_INDEXES</code> table
      in the <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_indexes_columns_table"></a><p class="title"><b>Table 24.21 INNODB_SYS_INDEXES Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_INDEXES table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">INDEX_ID</code></td>
          <td>An identifier for each index that is unique across all the databases in
            an instance.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>The name of the index. Most indexes created implicitly by
            <code class="literal">InnoDB</code> have consistent names but the
            index names are not necessarily unique. For example,
            <code class="literal">PRIMARY</code> for a primary key index,
            <code class="literal">GEN_CLUST_INDEX</code> for the index
            representing a primary key when one is not specified, and
            <code class="literal">ID_IND</code>, <code class="literal">FOR_IND</code>, and
            <code class="literal">REF_IND</code> for foreign key constraints.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TABLE_ID</code></td>
          <td>An identifier representing the table associated with the index; the same
            value from <code class="literal">INNODB_SYS_TABLES.TABLE_ID</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TYPE</code></td>
          <td>A numeric identifier signifying the kind of index. 0 = Secondary Index,
            1 = Clustered Index, 2 = Unique Index, 3 = Primary Index, 32
            = Full-text Index, 64 = Spatial Index, 128 = A secondary
            index that includes a
            <a class="link" href="glossary.html#glos_virtual_generated_column" title="virtual generated column">virtual
            generated column</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">N_FIELDS</code></td>
          <td>The number of columns in the index key. For the
            <code class="literal">GEN_CLUST_INDEX</code> indexes, this value is 0
            because the index is created using an artificial value
            rather than a real table column.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_NO</code></td>
          <td>The root page number of the index B-tree. For full-text indexes, the
            <code class="literal">PAGE_NO</code> field is unused and set to -1
            (<code class="literal">FIL_NULL</code>) because the full-text index is
            laid out in several B-trees (auxiliary tables).</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPACE</code></td>
          <td>An identifier for the tablespace where the index resides. 0 means the
            <code class="literal">InnoDB</code>
            <a class="link" href="glossary.html#glos_system_tablespace" title="system tablespace">system
            tablespace</a>. Any other number represents a table
            created in
            <a class="link" href="glossary.html#glos_file_per_table" title="file-per-table">file-per-table</a>
            mode with a separate <code class="literal">.ibd</code> file. This
            identifier stays the same after a
            <a class="link" href="sql-syntax.html#truncate-table" title="13.1.34 TRUNCATE TABLE Syntax"><code class="literal">TRUNCATE TABLE</code></a> statement.
            Because all indexes for a table reside in the same
            tablespace as the table, this value is not necessarily
            unique.</td>
        </tr><tr>
          <td scope="row"><code class="literal">MERGE_THRESHOLD</code></td>
          <td>The merge threshold value for index pages. If the amount of data in an
            index page falls below the
            <a class="link" href="innodb-storage-engine.html#index-page-merge-threshold" title="14.6.13 Configuring the Merge Threshold for Index Pages">MERGE_THRESHOLD</a>
            value when a row is deleted or when a row is shortened by an
            update operation, <code class="literal">InnoDB</code> attempts to
            merge the index page with the neighboring index page. The
            default threshold value is 50%. For more information, see
            <a class="xref" href="innodb-storage-engine.html#index-page-merge-threshold" title="14.6.13 Configuring the Merge Threshold for Index Pages">Section 14.6.13, “Configuring the Merge Threshold for Index Pages”</a>.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = 34\G</code></strong>
*************************** 1. row ***************************
       INDEX_ID: 39
           NAME: GEN_CLUST_INDEX
       TABLE_ID: 34
           TYPE: 1
       N_FIELDS: 0
        PAGE_NO: 3
          SPACE: 23
MERGE_THRESHOLD: 50
*************************** 2. row ***************************
       INDEX_ID: 40
           NAME: i1
       TABLE_ID: 34
           TYPE: 0
       N_FIELDS: 1
        PAGE_NO: 4
          SPACE: 23
MERGE_THRESHOLD: 50
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-tables-table"></a>24.31.22 The INFORMATION_SCHEMA INNODB_SYS_TABLES Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589791680"></a><p>
      The <code class="literal">INNODB_SYS_TABLES</code> table provides metadata
      about <code class="literal">InnoDB</code> tables, equivalent to the
      information from the <code class="literal">SYS_TABLES</code> table in the
      <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_tables_columns_table"></a><p class="title"><b>Table 24.22 INNODB_SYS_TABLES Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_TABLES table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_ID</code></td>
          <td>An identifier for each <code class="literal">InnoDB</code> table that is unique
            across all databases in the instance.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>The name of the table. Preceded by the database name where appropriate,
            for example <code class="literal">test/t1</code>. Names of databases
            and user tables are in the same case as they were originally
            defined, possibly influenced by the
            <a class="link" href="server-administration.html#sysvar_lower_case_table_names"><code class="literal">lower_case_table_names</code></a>
            setting.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FLAG</code></td>
          <td>Bit-level data about table format and storage characteristics including
            row format, compressed page size (if applicable), and
            whether or not the <code class="literal">DATA DIRECTORY</code> clause
            was used with <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> or
            <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">N_COLS</code></td>
          <td>The number of columns in the table. The number reported includes three
            hidden columns that are created by <code class="literal">InnoDB</code>
            (<code class="literal">DB_ROW_ID</code>, <code class="literal">DB_TRX_ID</code>,
            and <code class="literal">DB_ROLL_PTR</code>). The number reported
            also includes
            <a class="link" href="glossary.html#glos_virtual_generated_column" title="virtual generated column">virtual
            generated columns</a>, if present.</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPACE</code></td>
          <td>An identifier for the tablespace where the table resides. 0 means the
            <code class="literal">InnoDB</code>
            <a class="link" href="glossary.html#glos_system_tablespace" title="system tablespace">system
            tablespace</a>. Any other number represents either a
            <a class="link" href="glossary.html#glos_file_per_table" title="file-per-table">file-per-table</a>
            tablespace or a general tablespace. This identifier stays
            the same after a <a class="link" href="sql-syntax.html#truncate-table" title="13.1.34 TRUNCATE TABLE Syntax"><code class="literal">TRUNCATE
            TABLE</code></a> statement. For file-per-table tablespaces,
            this identifier is unique for tables across all databases in
            the instance.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FILE_FORMAT</code></td>
          <td>The table's file format (Antelope or Barracuda).</td>
        </tr><tr>
          <td scope="row"><code class="literal">ROW_FORMAT</code></td>
          <td>The table's row format (Compact, Redundant, Dynamic, or Compressed).</td>
        </tr><tr>
          <td scope="row"><code class="literal">ZIP_PAGE_SIZE</code></td>
          <td>The zip page size. Only applies to tables that use the Compressed row
            format.</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPACE_TYPE</code></td>
          <td>The type of tablespace to which the table belongs. Possible values
            include <code class="literal">System</code> for the system tablespace,
            <code class="literal">General</code> for general tablespaces, and
            <code class="literal">Single</code> for file-per-table tablespaces.
            Tables assigned to the system tablespace using
            <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> or
            <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a>
            <code class="literal">TABLESPACE=innodb_system</code> have a
            <code class="literal">General</code> <code class="literal">SPACE_TYPE</code>.
            For more information, see <a class="link" href="sql-syntax.html#create-tablespace" title="13.1.19 CREATE TABLESPACE Syntax"><code class="literal">CREATE
            TABLESPACE</code></a>.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE TABLE_ID = 214\G</code></strong>
*************************** 1. row ***************************
     TABLE_ID: 214
         NAME: test/t1
         FLAG: 129
       N_COLS: 4
        SPACE: 233
  FILE_FORMAT: Antelope
   ROW_FORMAT: Compact
ZIP_PAGE_SIZE: 0
   SPACE_TYPE: General
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>
<p>
      <span class="bold"><strong>Interpreting the INNODB_SYS_TABLES.FLAG
      Column Value</strong></span>:
    </p><p>
      The <code class="literal">INNODB_SYS_TABLES.FLAG</code> column provides
      bit-level information about the table's format and storage
      characteristics. You can interpret the <code class="literal">FLAG</code>
      column value by adding together the applicable decimal numeric
      values that are provided in the following table.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_tables_columns_table-flag-data"></a><p class="title"><b>Table 24.23 Bit Position Values for Interpreting INNODB_SYS_TABLES FLAG Column Data</b></p>
<div class="table-contents">
<table summary="Bit position values for interpreting INNODB_SYS_TABLES FLAG column data."><col width="2%"><col width="4%"><col width="4%"><thead><tr>
          <th scope="col">Bit Position</th>
          <th scope="col">Description</th>
          <th scope="col">Decimal Numeric Value</th>
        </tr></thead><tbody><tr>
          <td scope="row">0</td>
          <td>This bit is set if the row format is not <code class="literal">REDUNDANT</code>.
            In other words, it is set if the row format is
            <code class="literal">COMPACT</code>, <code class="literal">DYNAMIC</code> or
            <code class="literal">COMPRESSED</code>.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - <code class="literal">REDUNDANT</code>
                </p></li><li class="listitem"><p>
                  1 - <code class="literal">COMPACT</code>,
                  <code class="literal">DYNAMIC</code> or
                  <code class="literal">COMPRESSED</code>
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">1-4</td>
          <td>These four bits contain a small number that represents the compressed
            page size of the table. The
            <code class="literal">INNODB_SYS_TABLES.ZIP_PAGE_SIZE</code> field
            also reports the compressed page size, if applicable.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - Not Compressed
                </p></li><li class="listitem"><p>
                  2 - 1024 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  4 - 2048 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  6 - 4096 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  8 - 8192 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  10 - 16384 Byte Compressed Page Size
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">5</td>
          <td>This bit is set if the row format is <code class="literal">DYNAMIC</code> or
            <code class="literal">COMPRESSED</code>.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - <code class="literal">REDUNDANT</code> or
                  <code class="literal">COMPACT</code>
                </p></li><li class="listitem"><p>
                  32 - <code class="literal">DYNAMIC</code> or
                  <code class="literal">COMPRESSED</code>
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">6</td>
          <td>This bit is set if the <code class="literal">DATA DIRECTORY</code> option is used
            with <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> or
            <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a>. This bit is set
            for file-per-table tablespaces that are located in
            directories other than the default data directory
            (<a class="link" href="server-administration.html#sysvar_datadir"><code class="literal">datadir</code></a>). For these
            tables, a
            <code class="filename"><em class="replaceable"><code>tablename</code></em>.isl</code>
            file is present in the same location as the
            <code class="filename"><em class="replaceable"><code>tablename</code></em>.frm</code>
            file. The
            <code class="filename"><em class="replaceable"><code>tablename</code></em>.isl</code>
            file stores the actual directory path to the
            <code class="literal"><em class="replaceable"><code>tablename</code></em>.ibd</code>
            file-per-table tablespace file.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - Not a remote file-per-table tablespace
                </p></li><li class="listitem"><p>
                  64 - A remote file-per-table tablespace
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">7</td>
          <td>This bit is set if the table is assigned to a shared tablespace (either
            a general tablespace or a system tablespace) using the
            <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> or
            <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a>
            <code class="literal">TABLESPACE=<em class="replaceable"><code>tablespace_name</code></em></code>
            option.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - Table is located in a default location depending
                  on the value of the
                  <a class="link" href="innodb-storage-engine.html#sysvar_innodb_file_per_table"><code class="literal">innodb_file_per_table</code></a>.
                </p></li><li class="listitem"><p>
                  128 - The table is explicitly assigned to a shared
                  tablespace.
</p></li></ul>
</div>
</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      In the following, table <code class="literal">t1</code> uses
      <code class="literal">ROW_FORMAT=DYNAMIC</code> and has a
      <code class="literal">FLAG</code> value of 33. Based on the information in
      the preceding table, we can see that bit position 0 would be set
      to 1, and bit position 5 would be set to 32 for a table with a
      <code class="literal">DYNAMIC</code> row format. These values add up to a
      <code class="literal">FLAG</code> value of 33.
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>USE test;</code></strong>
Database changed

mysql&gt; <strong class="userinput"><code>SET GLOBAL innodb_file_format=Barracuda;</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>CREATE TABLE t1 (c1 int) ROW_FORMAT=DYNAMIC;</code></strong>
Query OK, 0 rows affected (0.02 sec)

mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1'\G</code></strong>
*************************** 1. row ***************************
     TABLE_ID: 89
         NAME: test/t1
         FLAG: 33
       N_COLS: 4
        SPACE: 75
  FILE_FORMAT: Barracuda
   ROW_FORMAT: Dynamic
ZIP_PAGE_SIZE: 0
1 row in set (0.00 sec)
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-tablespaces-table"></a>24.31.23 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589646528"></a><p>
      The <code class="literal">INNODB_SYS_TABLESPACES</code> table provides
      metadata about <code class="literal">InnoDB</code> file-per-table and
      general tablespaces, equivalent to the information in the
      <code class="literal">SYS_TABLESPACES</code> table in the
      <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        The <a class="link" href="information-schema.html#files-table" title="24.8 The INFORMATION_SCHEMA FILES Table"><code class="literal">INFORMATION_SCHEMA.FILES</code></a> table
        reports metadata for all <code class="literal">InnoDB</code> tablespace
        types including file-per-table tablespaces, general tablespaces,
        the system tablespace, the temporary tablespace, and undo
        tablespaces, if present.
</p>
</div>

<div class="table">
<a name="innodb-information-schema-innodb_sys_tablespaces_columns_table"></a><p class="title"><b>Table 24.24 INNODB_SYS_TABLESPACES Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_TABLESPACES table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">SPACE</code></td>
          <td>Tablespace Space ID.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>The database and table name.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FLAG</code></td>
          <td>Bit-level data about tablespace format and storage characteristics.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FILE_FORMAT</code></td>
          <td>The tablespace file format. For example,
            <a class="link" href="glossary.html#glos_antelope" title="Antelope">Antelope</a>,
            <a class="link" href="glossary.html#glos_barracuda" title="Barracuda">Barracuda</a>, or
            <code class="literal">Any</code>
            (<a class="link" href="glossary.html#glos_general_tablespace" title="general tablespace">general
            tablespaces</a> support any row format). The data in this
            field is interpreted from the tablespace flags information
            that resides in the <a class="link" href="glossary.html#glos_ibd_file" title=".ibd file">.ibd
            file</a>. For more information about
            <code class="literal">InnoDB</code> file formats, see
            <a class="xref" href="innodb-storage-engine.html#innodb-file-format" title="14.10 InnoDB File-Format Management">Section 14.10, “InnoDB File-Format Management”</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">ROW_FORMAT</code></td>
          <td>The tablespace row format (Compact or Redundant, Dynamic, or
            Compressed). The data in this field is interpreted from the
            tablespace flags information that resides in the
            <a class="link" href="glossary.html#glos_ibd_file" title=".ibd file">.ibd file</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PAGE_SIZE</code></td>
          <td>The tablespace page size. The data in this field is interpreted from the
            tablespace flags information that resides in the
            <a class="link" href="glossary.html#glos_ibd_file" title=".ibd file">.ibd file</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">ZIP_PAGE_SIZE</code></td>
          <td>The tablespace zip page size. The data in this field is interpreted from
            the tablespace flags information that resides in the
            <a class="link" href="glossary.html#glos_ibd_file" title=".ibd file">.ibd file</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPACE_TYPE</code></td>
          <td>The type of tablespace. Possible values include
            <code class="literal">General</code> for general tablespaces and
            <code class="literal">Single</code> for file-per-table tablespaces.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FS_BLOCK_SIZE</code></td>
          <td>The file system block size, which is the unit size used for hole
            punching. This column was added with the introduction of the
            <code class="literal">InnoDB</code>
            <a class="link" href="innodb-storage-engine.html#innodb-page-compression" title="14.9.2 InnoDB Page Compression">transparent page
            compression</a> feature.</td>
        </tr><tr>
          <td scope="row"><code class="literal">FILE_SIZE</code></td>
          <td>The apparent size of the file, which represents the maximum size of the
            file, uncompressed. This column was added with the
            introduction of the <code class="literal">InnoDB</code>
            <a class="link" href="innodb-storage-engine.html#innodb-page-compression" title="14.9.2 InnoDB Page Compression">transparent page
            compression</a> feature.</td>
        </tr><tr>
          <td scope="row"><code class="literal">ALLOCATED_SIZE</code></td>
          <td>The actual size of the file, which is the amount of space allocated on
            disk. This column was added with the introduction of the
            <code class="literal">InnoDB</code>
            <a class="link" href="innodb-storage-engine.html#innodb-page-compression" title="14.9.2 InnoDB Page Compression">transparent page
            compression</a> feature.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 26\G</code></strong>
*************************** 1. row ***************************
         SPACE: 26
          NAME: test/t1
          FLAG: 0
   FILE_FORMAT: Antelope
    ROW_FORMAT: Compact or Redundant
     PAGE_SIZE: 16384
 ZIP_PAGE_SIZE: 0
    SPACE_TYPE: Single
 FS_BLOCK_SIZE: 4096
     FILE_SIZE: 98304
ALLOCATED_SIZE: 65536
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          Because tablespace flags are always zero for all Antelope file
          formats (unlike table flags), there is no way to determine
          from this flag integer if the tablespace row format is
          Redundant or Compact. As a result, the possible values for the
          <code class="literal">ROW_FORMAT</code> field are <span class="quote">“<span class="quote">Compact or
          Redundant</span>”</span>, <span class="quote">“<span class="quote">Compressed</span>”</span>, or
          <span class="quote">“<span class="quote">Dynamic.</span>”</span>
        </p></li><li class="listitem"><p>
          With the introduction of general tablespaces,
          <code class="literal">InnoDB</code> system tablespace data (for SPACE 0)
          is exposed in <code class="literal">INNODB_SYS_TABLESPACES</code>.
</p></li></ul>
</div>
<p>
      <span class="bold"><strong>Interpreting the INNODB_SYS_TABLESPACES.FLAG
      Column Value</strong></span>:
    </p><p>
      The <code class="literal">INNODB_SYS_TABLESPACES.FLAG</code> column provides
      bit-level information about tablespace format and storage
      characteristics.
    </p><p>
      Until MySQL 5.6, table and tablespace flags were the same except
      for the bit position 0 settings. In MySQL 5.6, support was added
      for 4K and 8K pages, which required an additional 4 bits to hold
      the logical page size. Also in MySQL 5.6, support was added for
      the <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> and
      <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a> <code class="literal">DATA
      DIRECTORY</code> clause, which allows file-per-table
      tablespaces to be stored in a location outside of the MySQL data
      directory. This feature required an additional bit for both table
      and tablespace flags, but not at the same position.
    </p><p>
      You can interpret the tablespace <code class="literal">FLAG</code> column
      value by adding together the applicable decimal numeric values
      that are provided in the following table.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_tablespaces_columns_table-flag-data"></a><p class="title"><b>Table 24.25 Bit Position Values for Interpreting INNODB_SYS_TABLESPACES FLAG Column
Data</b></p>
<div class="table-contents">
<table summary="Bit position vlues for interpreting INNODB_SYS_TABLESPACES FLAG column data."><col width="2%"><col width="5%"><col width="3%"><thead><tr>
          <th scope="col">Bit Position</th>
          <th scope="col">Description</th>
          <th scope="col">Decimal Numeric Value</th>
        </tr></thead><tbody><tr>
          <td scope="row">0</td>
          <td>This bit is set if the row format of tables in the tablespace is
            <code class="literal">DYNAMIC</code> or <code class="literal">COMPRESSED</code>.
            This information can help you distinguish between Antelope
            and Barracuda file formats but not between
            <code class="literal">REDUNDANT</code> and <code class="literal">COMPACT</code>
            file formats (<code class="literal">DYNAMIC</code> and
            <code class="literal">COMPRESSED</code> row formats require the
            Barracuda file format). If it is a file-per-table
            tablespace, you must query
            <code class="literal">INNODB_SYS_TABLES</code> to determine which of
            the two Antelope row formats is used
            (<code class="literal">REDUNDANT</code> or
            <code class="literal">COMPACT</code>).</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - <code class="literal">REDUNDANT</code> or
                  <code class="literal">COMPACT</code>
                  (<code class="literal">FILE_FORMAT=Antelope</code>)
                </p></li><li class="listitem"><p>
                  1 - <code class="literal">DYNAMIC</code> or
                  <code class="literal">COMPRESSED</code>
                  (<code class="literal">FILE_FORMAT=Barracuda</code>)
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">1-4</td>
          <td>These four bits contain a small number that represents the compressed
            page size (the <code class="literal">KEY_BLOCK_SIZE</code> or
            <span class="quote">“<span class="quote">physical block size</span>”</span>) of the tablespace.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - Not Compressed
                </p></li><li class="listitem"><p>
                  2 - 1024 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  4 - 2048 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  6 - 4096 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  8 - 8192 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  10 - 16384 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  12 - 32768 Byte Compressed Page Size
                </p></li><li class="listitem"><p>
                  14 - 65536 Byte Compressed Page Size
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">5</td>
          <td>This bit is set for file-per-table tablespaces if the row format of the
            table is <code class="literal">DYNAMIC</code> or
            <code class="literal">COMPRESSED</code>. General tablespaces that do
            not contain compressed tables will have the first 6 bits set
            to zero, including this bit, making it appear to be the
            Antelope file format. But actually, general tablespaces may
            contain any combination of <code class="literal">REDUNDANT</code>,
            <code class="literal">COMPACT</code> and <code class="literal">DYNAMIC</code>
            tables. For more information about general tablespaces, see
            <a class="link" href="sql-syntax.html#create-tablespace" title="13.1.19 CREATE TABLESPACE Syntax"><code class="literal">CREATE TABLESPACE</code></a>.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - <code class="literal">REDUNDANT</code> or
                  <code class="literal">COMPACT</code>
                </p></li><li class="listitem"><p>
                  32 - <code class="literal">DYNAMIC</code> or
                  <code class="literal">COMPRESSED</code>
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">6-9</td>
          <td>These four bits contain a small number that represents the uncompressed
            page size (logical page size) of the tablespace. The setting
            is zero if the logical page size is the original
            <code class="literal">InnoDB</code> default page size of 16K.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  192 - 4096 Byte Logical/Uncompressed Page Size
                </p></li><li class="listitem"><p>
                  256 - 8192 Byte Logical/Uncompressed Page Size
                </p></li><li class="listitem"><p>
                  0 - 16384 Byte Logical/Uncompressed Page size
                </p></li><li class="listitem"><p>
                  384 - 32768 Byte Logical/Uncompressed Page Size
                </p></li><li class="listitem"><p>
                  448 - 65536 Byte Logical/Uncompressed Page Size
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">10</td>
          <td>This bit is set if the <code class="literal">DATA DIRECTORY</code> option is used
            with <a class="link" href="sql-syntax.html#create-table" title="13.1.18 CREATE TABLE Syntax"><code class="literal">CREATE TABLE</code></a> or
            <a class="link" href="sql-syntax.html#alter-table" title="13.1.8 ALTER TABLE Syntax"><code class="literal">ALTER TABLE</code></a>. This bit is set
            for file-per-table tablespaces that are located in
            directories other than the default data directory
            (<a class="link" href="server-administration.html#sysvar_datadir"><code class="literal">datadir</code></a>). For these
            tables, a
            <code class="filename"><em class="replaceable"><code>tablename</code></em>.isl</code>
            file is present in the same location as the
            <code class="filename"><em class="replaceable"><code>tablename</code></em>.frm</code>
            file. The
            <code class="filename"><em class="replaceable"><code>tablename</code></em>.isl</code>
            file stores the actual directory path to the
            <code class="literal"><em class="replaceable"><code>tablename</code></em>.ibd</code>
            file-per-table tablespace file.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - Not a remote file-per-table tablespace
                </p></li><li class="listitem"><p>
                  1024 - A remote file-per-table tablespace
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">11</td>
          <td>This bit is set if the tablespace is a shared general tablespace created
            using <a class="link" href="sql-syntax.html#create-tablespace" title="13.1.19 CREATE TABLESPACE Syntax"><code class="literal">CREATE TABLESPACE</code></a>.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - Table is located in a default location depending
                  on the value of the
                  <a class="link" href="innodb-storage-engine.html#sysvar_innodb_file_per_table"><code class="literal">innodb_file_per_table</code></a>
                  setting.
                </p></li><li class="listitem"><p>
                  2048 - The table was explicitly assigned to a shared
                  tablespace.
</p></li></ul>
</div>
</td>
        </tr><tr>
          <td scope="row">12</td>
          <td>This bit is set if the tablespace is dedicated to temporary tables. In
            MySQL 5.7, only the predefined <code class="filename">ibtmp1</code>
            tablespace uses this flag.</td>
<td>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                  0 - The tablespace does not contain temporary tables,
                  so it is not recreated upon startup.
                </p></li><li class="listitem"><p>
                  4096 - The tablespace contains temporary tables and is
                  recreated on startup.
</p></li></ul>
</div>
</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      In the following example, table <code class="literal">t1</code> is created
      with <a class="link" href="innodb-storage-engine.html#sysvar_innodb_file_per_table"><code class="literal">innodb_file_per_table=ON</code></a>,
      which creates table <code class="literal">t1</code> in its own tablespace.
      When querying <a class="link" href="information-schema.html#innodb-sys-tablespaces-table" title="24.31.23 The INFORMATION_SCHEMA INNODB_SYS_TABLESPACES Table"><code class="literal">INNODB_SYS_TABLESPACES</code></a>,
      we see that the tablespace has a <code class="literal">FLAG</code> value of
      33. To determine how this value is arrived at, review the bit
      values described in the preceding table. Bit 0 has a value of 1
      because table <code class="literal">t1</code> uses the
      <code class="literal">DYNAMIC</code> row format. Bit 5 has a value of 32
      because the tablespace is a file-per-table tablespace that uses a
      <code class="literal">DYNAMIC</code> row format. Bit position 6-9 is 0
      because <a class="link" href="innodb-storage-engine.html#sysvar_innodb_page_size"><code class="literal">innodb_page_size</code></a> is set
      to the default 16K value. The other bit values are not applicable
      and are therefore set to 0. The values for bit position 0 and bit
      position 5 add up to a <code class="literal">FLAG</code> value of 33.
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>USE test;</code></strong>
Database changed

mysql&gt; <strong class="userinput"><code>SHOW VARIABLES LIKE 'innodb_file_per_table';</code></strong>
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| innodb_file_per_table | ON    |
+-----------------------+-------+
1 row in set (0.00 sec)

mysql&gt; <strong class="userinput"><code>SHOW VARIABLES LIKE 'innodb_page_size';</code></strong>
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| innodb_page_size | 16384 |
+------------------+-------+
1 row in set (0.00 sec)

mysql&gt; <strong class="userinput"><code>SET GLOBAL innodb_file_format=Barracuda;</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>CREATE TABLE t1 (c1 int) ROW_FORMAT=DYNAMIC;</code></strong>
Query OK, 0 rows affected (0.02 sec)

mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE NAME LIKE 'test/t1'\G</code></strong>
*************************** 1. row ***************************
        SPACE: 75
         NAME: test/t1
         FLAG: 33
  FILE_FORMAT: Barracuda
   ROW_FORMAT: Dynamic
    PAGE_SIZE: 16384
ZIP_PAGE_SIZE: 0
1 row in set (0.00 sec)
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-tablestats-table"></a>24.31.24 The INFORMATION_SCHEMA INNODB_SYS_TABLESTATS View</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589458640"></a><p>
      The <code class="literal">INNODB_SYS_TABLESTATS</code> provides a view of
      low-level status information about <code class="literal">InnoDB</code>
      tables. This data is used by the MySQL optimizer to calculate
      which index to use when querying an <code class="literal">InnoDB</code>
      table. This information is derived from in-memory data structures
      rather than corresponding to data stored on disk. There is no
      corresponding internal <code class="literal">InnoDB</code> system table.
    </p><p>
      <code class="literal">InnoDB</code> tables are represented in this view if
      they have been opened since the last server restart, and not aged
      out of the table cache. Tables for which persistent stats are
      available are always represented in this view.
    </p><p>
      Table statistics are only updated for
      <a class="link" href="sql-syntax.html#delete" title="13.2.2 DELETE Syntax"><code class="literal">DELETE</code></a> or
      <a class="link" href="sql-syntax.html#update" title="13.2.11 UPDATE Syntax"><code class="literal">UPDATE</code></a> operations that modify
      indexed columns. Statistics are not updated by operations that
      only modify non-indexed columns.
    </p><p>
      For related usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-system-tables" title="14.15.3 InnoDB INFORMATION_SCHEMA System Tables">Section 14.15.3, “InnoDB INFORMATION_SCHEMA System Tables”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_tablestats_columns_table"></a><p class="title"><b>Table 24.26 INNODB_SYS_TABLESTATS Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_TABLESTATS table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_ID</code></td>
          <td>An identifier representing the table for which statistics are available,
            using the same value as
            <code class="literal">INNODB_SYS_TABLES.TABLE_ID</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>The name of the table, using the same value as
            <code class="literal">INNODB_SYS_TABLES.NAME</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">STATS_INITIALIZED</code></td>
          <td>The value is <code class="literal">Initialized</code> if the statistics are
            already collected, <code class="literal">Uninitialized</code> if not.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NUM_ROWS</code></td>
          <td>The current estimated number of rows in the table. Updated after each
            DML operation. Could be imprecise if uncommitted
            transactions are inserting into or deleting from the table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">CLUST_INDEX_SIZE</code></td>
          <td>Number of pages on disk that store the clustered index, which holds the
            <code class="literal">InnoDB</code> table data in primary key order.
            This value might be null if no statistics are collected yet
            for the table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">OTHER_INDEX_SIZE</code></td>
          <td>Number of pages on disk that store all secondary indexes for the table.
            This value might be null if no statistics are collected yet
            for the table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">MODIFIED_COUNTER</code></td>
          <td>The number of rows modified by DML operations, such as
            <code class="literal">INSERT</code>, <code class="literal">UPDATE</code>,
            <code class="literal">DELETE</code>, and also cascade operations from
            foreign keys. This column is reset each time table
            statistics are recalculated</td>
        </tr><tr>
          <td scope="row"><code class="literal">AUTOINC</code></td>
          <td>The next number to be issued for any auto-increment-based operation. The
            rate at which the <code class="literal">AUTOINC</code> value changes
            depends on how many times auto-increment numbers have been
            requested and how many numbers are granted per request.</td>
        </tr><tr>
          <td scope="row"><code class="literal">REF_COUNT</code></td>
          <td>When this counter reaches zero, the table metadata can be evicted from
            the table cache.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS where TABLE_ID = 71\G</code></strong>
*************************** 1. row ***************************
         TABLE_ID: 71
             NAME: test/t1
STATS_INITIALIZED: Initialized
         NUM_ROWS: 1
 CLUST_INDEX_SIZE: 1
 OTHER_INDEX_SIZE: 0
 MODIFIED_COUNTER: 1
          AUTOINC: 0
        REF_COUNT: 1
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table is primarily useful for expert-level performance
          monitoring, or when developing performance-related extensions
          for MySQL.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-sys-virtual-table"></a>24.31.25 The INFORMATION_SCHEMA INNODB_SYS_VIRTUAL Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589396304"></a><p>
      The <code class="literal">INNODB_SYS_VIRTUAL</code> table provides metadata
      about <code class="literal">InnoDB</code>
      <a class="link" href="glossary.html#glos_virtual_generated_column" title="virtual generated column">virtual generated
      columns</a> and columns upon which virtual generated columns
      are based, equivalent to information in the
      <code class="literal">SYS_VIRTUAL</code> table in the
      <code class="literal">InnoDB</code> data dictionary.
    </p><p>
      A row appears in the <code class="literal">INNODB_SYS_VIRTUAL</code> table
      for each column upon which a virtual generated column is based.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_sys_virtual_table"></a><p class="title"><b>Table 24.27 INNODB_SYS_VIRTUAL Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_SYS_VIRTUAL table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_ID</code></td>
          <td>An identifier representing the table associated with the virtual column;
            the same value as
            <code class="literal">INNODB_SYS_TABLES.TABLE_ID</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">POS</code></td>
          <td>The position value of the
            <a class="link" href="glossary.html#glos_virtual_generated_column" title="virtual generated column">virtual
            generated column</a>. The value is large because it
            encodes the column sequence number and ordinal position. The
            formula used to calculate the value uses a bitwise
            operation. The formula is <code class="literal">((nth virtual generated
            column for the InnoDB instance + 1) &lt;&lt; 16) + the
            ordinal position of the virtual generated column</code>.
            For example, if the first virtual generated column in the
            <code class="literal">InnoDB</code> instance is the third column of
            the table, the formula is (0 + 1) &lt;&lt; 16) + 2. The
            first virtual generated column in the
            <code class="literal">InnoDB</code> instance is always number 0. As
            the third column in the table, the ordinal position of the
            virtual generated column is 2. Ordinal positions are counted
            from 0.</td>
        </tr><tr>
          <td scope="row"><code class="literal">BASE_POS</code></td>
          <td>The ordinal position of the columns upon which a virtual generated
            column is based.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CREATE TABLE `t1` (</code></strong>
         <strong class="userinput"><code>`a` int(11) DEFAULT NULL,</code></strong>
         <strong class="userinput"><code>`b` int(11) DEFAULT NULL,</code></strong>
         <strong class="userinput"><code>`c` int(11) GENERATED ALWAYS AS (a+b) VIRTUAL,</code></strong>
         <strong class="userinput"><code>`h` varchar(10) DEFAULT NULL</code></strong>
       <strong class="userinput"><code>) ENGINE=InnoDB DEFAULT CHARSET=latin1;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_VIRTUAL</code></strong>
       <strong class="userinput"><code>WHERE TABLE_ID IN (SELECT TABLE_ID FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE "test/t1");</code></strong>
+----------+-------+----------+
| TABLE_ID | POS   | BASE_POS |
+----------+-------+----------+
|       95 | 65538 |        0 |
|       95 | 65538 |        1 |
+----------+-------+----------+
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If a constant value is assigned to a
          <a class="link" href="glossary.html#glos_virtual_generated_column" title="virtual generated column">virtual
          generated column</a>, as in the following example, an entry
          for the column does not appear in the
          <code class="literal">INNODB_SYS_VIRTUAL</code> table. For an entry to
          appear, a virtual generated column must have a base column.
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CREATE TABLE `t1` (</code></strong>
         <strong class="userinput"><code>`a` int(11) DEFAULT NULL,</code></strong>
         <strong class="userinput"><code>`b` int(11) DEFAULT NULL,</code></strong>
         <strong class="userinput"><code>`c` int(11) GENERATED ALWAYS AS (5) VIRTUAL</code></strong>
       <strong class="userinput"><code>) ENGINE=InnoDB DEFAULT CHARSET=latin1;</code></strong>
</pre><p>
          However, metadata for such a column appears in the
          <a class="link" href="information-schema.html#innodb-sys-columns-table" title="24.31.16 The INFORMATION_SCHEMA INNODB_SYS_COLUMNS Table"><code class="literal">INNODB_SYS_COLUMNS</code></a> table.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-temp-table-info-table"></a>24.31.26 The INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589344784"></a><p>
      <code class="literal">INNODB_TEMP_TABLE_INFO</code> provides information
      about user-created <code class="literal">InnoDB</code> temporary tables that
      are currently active within the <code class="literal">InnoDB</code>
      instance. It does not provide information about internal
      <code class="literal">InnoDB</code> temporary tables that are used by the
      optimizer. The <code class="literal">INNODB_TEMP_TABLE_INFO</code> table is
      created when it is first queried and only exists in memory. It is
      not persisted to disk.
    </p><p>
      For usage information and examples, see
      <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-temp-table-info" title="14.15.7 InnoDB INFORMATION_SCHEMA Temporary Table Info Table">Section 14.15.7, “InnoDB INFORMATION_SCHEMA Temporary Table Info Table”</a>.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_temp_table_info"></a><p class="title"><b>Table 24.28 INNODB_TEMP_TABLE_INFO Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_TEMP_TABLE_INFO table."><col width="3%"><col width="8%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TABLE_ID</code></td>
          <td>The table ID of the active temporary table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">NAME</code></td>
          <td>The name of the active temporary table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">N_COLS</code></td>
          <td>The number of columns in the temporary table. The number always includes
            three hidden columns created by <code class="literal">InnoDB</code>
            (DB_ROW_ID, DB_TRX_ID, and DB_ROLL_PTR).</td>
        </tr><tr>
          <td scope="row"><code class="literal">SPACE</code></td>
          <td>The tablespace identifier (a numerical value) for the tablespace where
            the temporary table resides. In 5.7, all
            non-compressed <code class="literal">InnoDB</code> temporary tables
            reside in a shared temporary tablespace. The data file for
            the shared temporary tablespace is defined by the
            <a class="link" href="innodb-storage-engine.html#sysvar_innodb_temp_data_file_path"><code class="literal">innodb_temp_data_file_path</code></a>
            configuration option. By default, there is a single data
            file for the shared temporary tablespace named
            <code class="filename">ibtmp1</code>, which is located in the
            <code class="filename">data</code> directory. Compressed temporary
            tables reside in separate file-per-table tablespaces located
            in the temporary file directory, as defined by
            <a class="link" href="server-administration.html#sysvar_tmpdir"><code class="literal">tmpdir</code></a>. The
            <code class="literal">SPACE</code> ID for the temporary tablespace is
            always a nonzero value and is dynamically generated on
            server restart.</td>
        </tr><tr>
          <td scope="row"><code class="literal">PER_TABLE_SPACE</code></td>
          <td>A value of <code class="literal">TRUE</code> indicates that the temporary table
            resides in a separate file-per-table tablespace. A value of
            <code class="literal">FALSE</code> indicates that the temporary table
            resides in the shared temporary tablespace.</td>
        </tr><tr>
          <td scope="row"><code class="literal">IS_COMPRESSED</code></td>
          <td>A value of <code class="literal">TRUE</code> indicates that the temporary table is
            compressed.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CREATE TEMPORARY TABLE t1 (c1 INT PRIMARY KEY) ENGINE=INNODB;</code></strong>
Query OK, 0 rows affected (0.01 sec)

mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFO\G</code></strong>
*************************** 1. row ***************************
            TABLE_ID: 38
                NAME: #sql26cf_6_0
              N_COLS: 4
               SPACE: 52
PER_TABLE_TABLESPACE: FALSE
       IS_COMPRESSED: FALSE
1 row in set (0.00 sec)
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          This table is primarily useful for expert level monitoring.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innodb-trx-table"></a>24.31.27 The INFORMATION_SCHEMA INNODB_TRX Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589292128"></a><p>
      The <code class="literal">INNODB_TRX</code> table contains information about
      every transaction (excluding read-only transactions) currently
      executing inside <code class="literal">InnoDB</code>, including whether the
      transaction is waiting for a lock, when the transaction started,
      and the SQL statement the transaction is executing, if any.
</p>
<div class="table">
<a name="innodb-information-schema-innodb_trx_columns_table"></a><p class="title"><b>Table 24.29 INNODB_TRX Columns</b></p>
<div class="table-contents">
<table summary="Columns in the INFORMATION_SCHEMA INNODB_TRX table."><col width="1%"><col width="2%"><thead><tr>
          <th scope="col">Column name</th>
          <th scope="col">Description</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">TRX_ID</code></td>
          <td>Unique transaction ID number, internal to <code class="literal">InnoDB</code>.
            These IDs are not created for transactions that are read
            only and nonlocking. See
            <a class="xref" href="optimization.html#innodb-performance-ro-txn" title="8.5.3 Optimizing InnoDB Read-Only Transactions">Section 8.5.3, “Optimizing InnoDB Read-Only Transactions”</a> for details.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_WEIGHT</code></td>
          <td>The weight of a transaction, reflecting (but not necessarily the exact
            count of) the number of rows altered and the number of rows
            locked by the transaction. To resolve a deadlock,
            <code class="literal">InnoDB</code> selects the transaction with the
            smallest weight as the <span class="quote">“<span class="quote">victim</span>”</span> to roll back.
            Transactions that have changed non-transactional tables are
            considered heavier than others, regardless of the number of
            altered and locked rows.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_STATE</code></td>
          <td>Transaction execution state. Permitted values are
            <code class="literal">RUNNING</code>, <code class="literal">LOCK WAIT</code>,
            <code class="literal">ROLLING BACK</code>, and
            <code class="literal">COMMITTING</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_STARTED</code></td>
          <td>Transaction start time.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_REQUESTED_LOCK_ID</code></td>
          <td>ID of the lock the transaction is currently waiting for, if
            <code class="literal">TRX_STATE</code> is <code class="literal">LOCK
            WAIT</code>; otherwise <code class="literal">NULL</code>. To obtain
            details about the lock, join this column with the
            <code class="literal">LOCK_ID</code> column of the
            <a class="link" href="information-schema.html#innodb-locks-table" title="24.31.13 The INFORMATION_SCHEMA INNODB_LOCKS Table"><code class="literal">INNODB_LOCKS</code></a> table.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_WAIT_STARTED</code></td>
          <td>Time when the transaction started waiting on the lock, if
            <code class="literal">TRX_STATE</code> is <code class="literal">LOCK
            WAIT</code>; otherwise <code class="literal">NULL</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_MYSQL_THREAD_ID</code></td>
          <td>MySQL thread ID. To obtain details about the thread, join this column
            with the <code class="literal">ID</code> column of the
            <code class="literal">INFORMATION_SCHEMA</code>
            <a class="link" href="information-schema.html#processlist-table" title="24.17 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">PROCESSLIST</code></a> table, but see
            <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-internal-data" title="14.15.2.3 Persistence and Consistency of InnoDB Transaction and Locking Information">Section 14.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking
        Information”</a>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_QUERY</code></td>
          <td>The SQL statement that is being executed by the transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_OPERATION_STATE</code></td>
          <td>The transaction's current operation, if any; otherwise
            <code class="literal">NULL</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_TABLES_IN_USE</code></td>
          <td>The number of <code class="literal">InnoDB</code> tables used while processing the
            current SQL statement of this transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_TABLES_LOCKED</code></td>
          <td>Number of <code class="literal">InnoDB</code> tables that the current SQL
            statement has row locks on. (Because these are row locks,
            not table locks, the tables can usually still be read from
            and written to by multiple transactions, despite some rows
            being locked.)</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_LOCK_STRUCTS</code></td>
          <td>The number of locks reserved by the transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_LOCK_MEMORY_BYTES</code></td>
          <td>Total size taken up by the lock structures of this transaction in
            memory.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_ROWS_LOCKED</code></td>
          <td>Approximate number or rows locked by this transaction. The value might
            include delete-marked rows that are physically present but
            not visible to the transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_ROWS_MODIFIED</code></td>
          <td>The number of modified and inserted rows in this transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_CONCURRENCY_TICKETS</code></td>
          <td>A value indicating how much work the current transaction can do before
            being swapped out, as specified by the
            <a class="link" href="innodb-storage-engine.html#sysvar_innodb_concurrency_tickets"><code class="literal">innodb_concurrency_tickets</code></a>
            system variable.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_ISOLATION_LEVEL</code></td>
          <td>The isolation level of the current transaction.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_UNIQUE_CHECKS</code></td>
          <td>Whether unique checks are turned on or off for the current transaction.
            For example, they might be turned off during a bulk data
            load.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_FOREIGN_KEY_CHECKS</code></td>
          <td>Whether foreign key checks are turned on or off for the current
            transaction. For example, they might be turned off during a
            bulk data load.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_LAST_FOREIGN_KEY_ERROR</code></td>
          <td>Detailed error message for the last foreign key error, if any; otherwise
            <code class="literal">NULL</code>.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_ADAPTIVE_HASH_LATCHED</code></td>
          <td>Whether the adaptive hash index is locked by the current transaction.
            When the adaptive hash index search system is partitioned, a
            single transaction does not lock the entire adaptive hash
            index. Adaptive hash index partitioning is controlled by
            <a class="link" href="innodb-storage-engine.html#sysvar_innodb_adaptive_hash_index_parts"><code class="literal">innodb_adaptive_hash_index_parts</code></a>,
            which is set to 8 by default.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_ADAPTIVE_HASH_TIMEOUT</code></td>
          <td>Whether to relinquish the search latch immediately for the adaptive hash
            index, or reserve it across calls from MySQL. When there is
            no adaptive hash index contention, this value remains zero
            and statements reserve the latch until they finish. During
            times of contention, it counts down to zero, and statements
            release the latch immediately after each row lookup. When
            the adaptive hash index search system is partitioned
            (controlled by
            <a class="link" href="innodb-storage-engine.html#sysvar_innodb_adaptive_hash_index_parts"><code class="literal">innodb_adaptive_hash_index_parts</code></a>),
            the value remains 0.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_IS_READ_ONLY</code></td>
          <td>A value of 1 indicates the transaction is read only.</td>
        </tr><tr>
          <td scope="row"><code class="literal">TRX_AUTOCOMMIT_NON_LOCKING</code></td>
          <td>A value of 1 indicates the transaction is a
            <a class="link" href="sql-syntax.html#select" title="13.2.9 SELECT Syntax"><code class="literal">SELECT</code></a> statement that does
            not use the <code class="literal">FOR UPDATE</code> or <code class="literal">LOCK
            IN SHARED MODE</code> clauses, and is executing with
            <a class="link" href="server-administration.html#sysvar_autocommit"><code class="literal">autocommit</code></a> enabled so that
            the transaction will only contain this one statement. When
            this column and <code class="literal">TRX_IS_READ_ONLY</code> are both
            1, <code class="literal">InnoDB</code> optimizes the transaction to
            reduce the overhead associated with transactions that change
            table data.</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
      <span class="bold"><strong>Example</strong></span>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX\G</code></strong>
*************************** 1. row ***************************
                    trx_id: 1510
                 trx_state: RUNNING
               trx_started: 2014-11-19 13:24:40
     trx_requested_lock_id: NULL
          trx_wait_started: NULL
                trx_weight: 586739
       trx_mysql_thread_id: 2
                 trx_query: DELETE FROM employees.salaries WHERE salary &gt; 65000
       trx_operation_state: updating or deleting
         trx_tables_in_use: 1
         trx_tables_locked: 1
          trx_lock_structs: 3003
     trx_lock_memory_bytes: 450768
           trx_rows_locked: 1407513
         trx_rows_modified: 583736
   trx_concurrency_tickets: 0
       trx_isolation_level: REPEATABLE READ
         trx_unique_checks: 1
    trx_foreign_key_checks: 1
trx_last_foreign_key_error: NULL
 trx_adaptive_hash_latched: 0
 trx_adaptive_hash_timeout: 10000
          trx_is_read_only: 0
trx_autocommit_non_locking: 0
</pre><p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Use this table to help diagnose performance problems that
          occur during times of heavy concurrent load. Its contents are
          updated as described in
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-internal-data" title="14.15.2.3 Persistence and Consistency of InnoDB Transaction and Locking Information">Section 14.15.2.3, “Persistence and Consistency of InnoDB Transaction and Locking
        Information”</a>.
        </p></li><li class="listitem"><p>
          Use <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> or
          <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> to view additional
          information about the columns of this table including data
          types and default values.
        </p></li><li class="listitem"><p>
          You must have the <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a>
          privilege to query this table.
        </p></li><li class="listitem"><p>
          For usage information, see
          <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-examples" title="14.15.2.1 Using InnoDB Transaction and Locking Information">Section 14.15.2.1, “Using InnoDB Transaction and Locking Information”</a>.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="thread-pool-i_s-tables"></a>24.32 Thread Pool INFORMATION_SCHEMA Tables</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="information-schema.html#tp-thread-group-state-table">24.32.1 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATE Table</a></span></dt><dt><span class="section"><a href="information-schema.html#tp-thread-group-stats-table">24.32.2 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATS Table</a></span></dt><dt><span class="section"><a href="information-schema.html#tp-thread-state-table">24.32.3 The INFORMATION_SCHEMA TP_THREAD_STATE Table</a></span></dt></dl>
</div>
<a class="indexterm" name="idm140710589167168"></a><p>
    The following sections describe the
    <code class="literal">INFORMATION_SCHEMA</code> tables associated with the
    thread pool plugin. They provide information about thread pool
    operation:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        <a class="link" href="information-schema.html#tp-thread-group-state-table" title="24.32.1 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATE Table"><code class="literal">TP_THREAD_GROUP_STATE</code></a>: Information
        about thread pool thread group states
      </p></li><li class="listitem"><p>
        <a class="link" href="information-schema.html#tp-thread-group-stats-table" title="24.32.2 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATS Table"><code class="literal">TP_THREAD_GROUP_STATS</code></a>: Thread group
        statistics
      </p></li><li class="listitem"><p>
        <a class="link" href="information-schema.html#tp-thread-state-table" title="24.32.3 The INFORMATION_SCHEMA TP_THREAD_STATE Table"><code class="literal">TP_THREAD_STATE</code></a>: Information about
        thread pool thread states
</p></li></ul>
</div>
<p>
    Rows in these tables represent snapshots in time. In the case of
    <a class="link" href="information-schema.html#tp-thread-state-table" title="24.32.3 The INFORMATION_SCHEMA TP_THREAD_STATE Table"><code class="literal">TP_THREAD_STATE</code></a>, all rows for a thread
    group comprise a snapshot in time. Thus, the MySQL server holds the
    mutex of the thread group while producing the snapshot. But it does
    not hold mutexes on all thread groups at the same time, to prevent a
    statement against <a class="link" href="information-schema.html#tp-thread-state-table" title="24.32.3 The INFORMATION_SCHEMA TP_THREAD_STATE Table"><code class="literal">TP_THREAD_STATE</code></a> from
    blocking the entire MySQL server.
  </p><p>
    The thread pool <code class="literal">INFORMATION_SCHEMA</code> tables are
    implemented by individual plugins and the decision whether to load
    one can be made independently of the others (see
    <a class="xref" href="server-administration.html#thread-pool-installation" title="5.5.3.2 Thread Pool Installation">Section 5.5.3.2, “Thread Pool Installation”</a>). However, the content of
    all the tables depends on the thread pool plugin being enabled. If a
    table plugin is enabled but the thread pool plugin is not, the table
    becomes visible and can be accessed but will be empty.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="tp-thread-group-state-table"></a>24.32.1 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATE Table</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm140710589151184"></a><p>
      This table has one row per thread group in the thread pool. Each
      row provides information about the current state of a group. The
      table has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">TP_GROUP_ID</code>
        </p><p>
          The thread group ID. This is a unique key within the table.
        </p></li><li class="listitem"><p>
          <code class="literal">CONSUMER THREADS</code>
        </p><p>
          The number of consumer threads. There is at most one thread
          ready to start executing if the active threads become stalled
          or blocked.
        </p></li><li class="listitem"><p>
          <code class="literal">RESERVE_THREADS</code>
        </p><p>
          The number of threads in the reserved state. This means that
          they will not be started until there is a need to wake a new
          thread and there is no consumer thread. This is where most
          threads end up when the thread group has created more threads
          than needed for normal operation. Often a thread group needs
          additional threads for a short while and then does not need
          them again for a while. In this case, they go into the
          reserved state and remain until needed again. They take up
          some extra memory resources, but no extra computing resources.
        </p></li><li class="listitem"><p>
          <code class="literal">CONNECT_THREAD_COUNT</code>
        </p><p>
          The number of threads that are processing or waiting to
          process connection initialization and authentication. There
          can be a maximum of four connection threads per thread group;
          these threads expire after a period of inactivity.
        </p><p>
          This column was added in MySQL 5.7.18.
        </p></li><li class="listitem"><p>
          <code class="literal">CONNECTION_COUNT</code>
        </p><p>
          The number of connections using this thread group.
        </p></li><li class="listitem"><p>
          <code class="literal">QUEUED_QUERIES</code>
        </p><p>
          The number of statements waiting in the high-priority queue.
        </p></li><li class="listitem"><p>
          <code class="literal">QUEUED_TRANSACTIONS</code>
        </p><p>
          The number of statements waiting in the low-priority queue.
          These are the initial statements for transactions that have
          not started, so they also represent queued transactions.
        </p></li><li class="listitem"><p>
          <code class="literal">STALL_LIMIT</code>
        </p><p>
          The value of the
          <a class="link" href="server-administration.html#sysvar_thread_pool_stall_limit"><code class="literal">thread_pool_stall_limit</code></a>
          variable on the thread group. This is the same value for all
          thread groups.
        </p></li><li class="listitem"><p>
          <code class="literal">PRIO_KICKUP_TIMER</code>
        </p><p>
          The value of the
          <a class="link" href="server-administration.html#sysvar_thread_pool_prio_kickup_timer"><code class="literal">thread_pool_prio_kickup_timer</code></a>
          on the thread group. This is the same value for all thread
          groups.
        </p></li><li class="listitem"><p>
          <code class="literal">ALGORITHM</code>
        </p><p>
          The value of the
          <a class="link" href="server-administration.html#sysvar_thread_pool_algorithm"><code class="literal">thread_pool_algorithm</code></a> on the
          thread group. This is the same value for all thread groups.
        </p></li><li class="listitem"><p>
          <code class="literal">THREAD_COUNT</code>
        </p><p>
          The number of threads started in the thread pool as part of
          this thread group.
        </p></li><li class="listitem"><p>
          <code class="literal">ACTIVE_THREAD_COUNT</code>
        </p><p>
          The number of threads active executing statements.
        </p></li><li class="listitem"><p>
          <code class="literal">MAX_THREAD_IDS_IN_GROUP</code>
        </p><p>
          The maximum thread ID of the threads in the group. This is the
          same as <a class="link" href="functions.html#function_max"><code class="literal">MAX(TP_THREAD_NUMBER)</code></a>
          for the threads when selected from the
          <a class="link" href="information-schema.html#tp-thread-group-state-table" title="24.32.1 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATE Table"><code class="literal">TP_THREAD_GROUP_STATE</code></a> table. That
          is, these two queries are equivalent:
        </p><pre data-lang="sql" class="programlisting">
SELECT TP_GROUP_ID, MAX_THREAD_IDS_IN_GROUP
FROM TP_THREAD_GROUP_STATE;

SELECT TP_GROUP_ID, MAX(TP_THREAD_NUMBER)
FROM TP_THREAD_STATE GROUP BY TP_GROUP_ID;
</pre></li><li class="listitem"><p>
          <code class="literal">STALLED_THREAD_COUNT</code>
        </p><p>
          The number of stalled statements in the thread group. A
          stalled statement could be executing, but from a thread pool
          perspective it is stalled and making no progress. A
          long-running statement quickly ends up in this category.
        </p></li><li class="listitem"><p>
          <code class="literal">WAITING_THREAD_NUMBER</code>
        </p><p>
          If there is a thread handling the polling of statements in the
          thread group, this specifies the thread number within this
          thread group. It is possible that this thread could be
          executing a statement.
        </p></li><li class="listitem"><p>
          <code class="literal">OLDEST_QUEUED</code>
        </p><p>
          How long in milliseconds the oldest queued statement has been
          waiting for execution.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="tp-thread-group-stats-table"></a>24.32.2 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATS Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589107072"></a><p>
      This table reports statistics per thread group. There is one row
      per group. The table has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">TP_GROUP_ID</code>
        </p><p>
          The thread group ID. This is a unique key within the table.
        </p></li><li class="listitem"><p>
          <code class="literal">CONNECTIONS_STARTED</code>
        </p><p>
          The number of connections started.
        </p></li><li class="listitem"><p>
          <code class="literal">CONNECTIONS_CLOSED</code>
        </p><p>
          The number of connections closed.
        </p></li><li class="listitem"><p>
          <code class="literal">QUERIES_EXECUTED</code>
        </p><p>
          The number of statements executed. This number is incremented
          when a statement starts executing, not when it finishes.
        </p></li><li class="listitem"><p>
          <code class="literal">QUERIES_QUEUED</code>
        </p><p>
          The number of statements received that were queued for
          execution. This does not count statements that the thread
          group was able to begin executing immediately without queuing,
          which can happen under the conditions described in
          <a class="xref" href="server-administration.html#thread-pool-operation" title="5.5.3.3 Thread Pool Operation">Section 5.5.3.3, “Thread Pool Operation”</a>.
        </p></li><li class="listitem"><p>
          <code class="literal">THREADS_STARTED</code>
        </p><p>
          The number of threads started.
        </p></li><li class="listitem"><p>
          <code class="literal">PRIO_KICKUPS</code>
        </p><p>
          The number of statements that have been moved from
          low-priority queue to high-priority queue based on the value
          of the
          <a class="link" href="server-administration.html#sysvar_thread_pool_prio_kickup_timer"><code class="literal">thread_pool_prio_kickup_timer</code></a>
          system variable. If this number increases quickly, consider
          increasing the value of that variable. A quickly increasing
          counter means that the priority system is not keeping
          transactions from starting too early. For
          <a class="link" href="innodb-storage-engine.html" title="Chapter 14 The InnoDB Storage Engine"><code class="literal">InnoDB</code></a>, this most likely means
          deteriorating performance due to too many concurrent
          transactions..
        </p></li><li class="listitem"><p>
          <code class="literal">STALLED_QUERIES_EXECUTED</code>
        </p><p>
          The number of statements that have become defined as stalled
          due to executing for a time longer than the value of the
          <a class="link" href="server-administration.html#sysvar_thread_pool_stall_limit"><code class="literal">thread_pool_stall_limit</code></a>
          system variable.
        </p></li><li class="listitem"><p>
          <code class="literal">BECOME_CONSUMER_THREAD</code>
        </p><p>
          The number of times thread have been assigned the consumer
          thread role.
        </p></li><li class="listitem"><p>
          <code class="literal">BECOME_RESERVE_THREAD</code>
        </p><p>
          The number of times threads have been assigned the reserve
          thread role.
        </p></li><li class="listitem"><p>
          <code class="literal">BECOME_WAITING_THREAD</code>
        </p><p>
          The number of times threads have been assigned the waiter
          thread role. When statements are queued, this happens very
          often, even in normal operation, so rapid increases in this
          value are normal in the case of a highly loaded system where
          statements are queued up.
        </p></li><li class="listitem"><p>
          <code class="literal">WAKE_THREAD_STALL_CHECKER</code>
        </p><p>
          The number of times the stall check thread decided to wake or
          create a thread to possibly handle some statements or take
          care of the waiter thread role.
        </p></li><li class="listitem"><p>
          <code class="literal">SLEEP_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_SLEEP</code> waits. These
          occur when threads go to sleep; for example, by calling the
          <a class="link" href="functions.html#function_sleep"><code class="literal">SLEEP()</code></a> function.
        </p></li><li class="listitem"><p>
          <code class="literal">DISK_IO_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_DISKIO</code> waits. These
          occur when threads perform disk I/O that is likely to not hit
          the file system cache. Such waits occur when the buffer pool
          reads and writes data to disk, not for normal reads from and
          writes to files.
        </p></li><li class="listitem"><p>
          <code class="literal">ROW_LOCK_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_ROW_LOCK</code> waits for
          release of a row lock by another transaction.
        </p></li><li class="listitem"><p>
          <code class="literal">GLOBAL_LOCK_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_GLOBAL_LOCK</code> waits
          for a global lock to be released.
        </p></li><li class="listitem"><p>
          <code class="literal">META_DATA_LOCK_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_META_DATA_LOCK</code> waits
          for a metadata lock to be released.
        </p></li><li class="listitem"><p>
          <code class="literal">TABLE_LOCK_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_TABLE_LOCK</code> waits for
          a table to be unlocked that the statement needs to access.
        </p></li><li class="listitem"><p>
          <code class="literal">USER_LOCK_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_USER_LOCK</code> waits for
          a special lock constructed by the user thread.
        </p></li><li class="listitem"><p>
          <code class="literal">BINLOG_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_BINLOG_WAITS</code> waits
          for the binary log to become free.
        </p></li><li class="listitem"><p>
          <code class="literal">GROUP_COMMIT_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_GROUP_COMMIT</code> waits.
          These occur when a group commit must wait for the other
          parties to complete their part of a transaction.
        </p></li><li class="listitem"><p>
          <code class="literal">FSYNC_WAITS</code>
        </p><p>
          The number of <code class="literal">THD_WAIT_SYNC</code> waits for a
          file sync operation.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="tp-thread-state-table"></a>24.32.3 The INFORMATION_SCHEMA TP_THREAD_STATE Table</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm140710589046544"></a><p>
      This table has one row per thread created by the thread pool to
      handle connections. The table has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">TP_GROUP_ID</code>
        </p><p>
          The thread group ID.
        </p></li><li class="listitem"><p>
          <code class="literal">TP_THREAD_NUMBER</code>
        </p><p>
          The ID of the thread within its thread group.
          <code class="literal">TP_GROUP_ID</code> and
          <code class="literal">TP_THREAD_NUMBER</code> together provide a unique
          key within the table.
        </p></li><li class="listitem"><p>
          <code class="literal">PROCESS_COUNT</code>
        </p><p>
          The 10ms interval in which the statement that uses this thread
          is currently executing. 0 means no statement is executing, 1
          means it is in the first 10ms, and so forth.
        </p></li><li class="listitem"><p>
          <code class="literal">WAIT_TYPE</code>
        </p><p>
          The type of wait for the thread. <code class="literal">NULL</code> means
          the thread is not blocked. Otherwise, the thread is blocked by
          a call to <code class="literal">thd_wait_begin()</code> and the value
          specifies the type of wait. The
          <code class="literal"><em class="replaceable"><code>xxx</code></em>_WAIT</code> columns
          of the <a class="link" href="information-schema.html#tp-thread-group-stats-table" title="24.32.2 The INFORMATION_SCHEMA TP_THREAD_GROUP_STATS Table"><code class="literal">TP_THREAD_GROUP_STATS</code></a>
          table accumulate counts for each wait type.
        </p><p>
          The <code class="literal">WAIT_TYPE</code> value is a string that
          describes the type of wait, as shown in the following table.
</p>
<div class="table">
<a name="idm140710589030000"></a><p class="title"><b>Table 24.30 WAIT_TYPE Values</b></p>
<div class="table-contents">
<table summary="WAIT_TYPE values. The first column is the wait type. The second column describes the wait type."><col width="35%"><col width="65%"><thead><tr>
              <th scope="col">Wait Type</th>
              <th scope="col">Meaning</th>
            </tr></thead><tbody><tr>
              <td scope="row"><code class="literal">THD_WAIT_SLEEP</code></td>
              <td>Waiting for sleep</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_DISKIO</code></td>
              <td>Waiting for Disk IO</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_ROW_LOCK</code></td>
              <td>Waiting for row lock</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_GLOBAL_LOCK</code></td>
              <td>Waiting for global lock</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_META_DATA_LOCK</code></td>
              <td>Waiting for metadata lock</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_TABLE_LOCK</code></td>
              <td>Waiting for table lock</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_USER_LOCK</code></td>
              <td>Waiting for user lock</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_BINLOG</code></td>
              <td>Waiting for binlog</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_GROUP_COMMIT</code></td>
              <td>Waiting for group commit</td>
            </tr><tr>
              <td scope="row"><code class="literal">THD_WAIT_SYNC</code></td>
              <td>Waiting for fsync</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="connection-control-i_s-tables"></a>24.33 Connection-Control INFORMATION_SCHEMA Tables</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="information-schema.html#connection-control-failed-login-attempts-table">24.33.1 The INFORMATION_SCHEMA CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS Table</a></span></dt></dl>
</div>
<a class="indexterm" name="idm140710588994096"></a><p>
    The following sections describe the
    <code class="literal">INFORMATION_SCHEMA</code> tables associated with the
    <code class="literal">CONNECTION_CONTROL</code> plugin.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="connection-control-failed-login-attempts-table"></a>24.33.1 The INFORMATION_SCHEMA CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS Table</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm140710588989520"></a><p>
      This table provides information about the current number of
      consecutive failed connection attempts per client user/host
      combination. The table was added in MySQL 5.7.17.
    </p><p>
      <a class="link" href="information-schema.html#connection-control-failed-login-attempts-table" title="24.33.1 The INFORMATION_SCHEMA CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS Table"><code class="literal">CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS</code></a>
      has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <code class="literal">USERHOST</code>
        </p><p>
          The user/host combination of a client that has failed
          connection attempts, in
          <code class="literal">'<em class="replaceable"><code>user_name</code></em>'@'<em class="replaceable"><code>host_name</code></em>'</code>
          format.
        </p></li><li class="listitem"><p>
          <code class="literal">FAILED_ATTEMPTS</code>
        </p><p>
          The current number of consecutive failed connection attempts
          for the <code class="literal">USERHOST</code> value. This counts all
          failed attempts, regardless of whether they were delayed. The
          number of attempts for which the server added a delay to its
          response is the difference between the
          <code class="literal">FAILED_ATTEMPTS</code> value and the
          <a class="link" href="security.html#sysvar_connection_control_failed_connections_threshold"><code class="literal">connection_control_failed_connections_threshold</code></a>
          system variable value.
</p></li></ul>
</div>
<p>
      <span class="bold"><strong>Notes</strong></span>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The
          <code class="literal">CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS</code>
          plugin must be activated for this table to be available, and
          the <code class="literal">CONNECTION_CONTROL</code> plugin must be
          activated or the table contents will always be empty. See
          <a class="xref" href="security.html#connection-control" title="6.5.2 The Connection-Control Plugins">Section 6.5.2, “The Connection-Control Plugins”</a>.
        </p></li><li class="listitem"><p>
          The table contains rows only for clients that have had one or
          more consecutive failed connection attempts without a
          subsequent successful attempt. When a client connects
          successfully, its failed-connection count is reset to zero and
          the server removes any row corresponding to the client.
        </p></li><li class="listitem"><p>
          Assigning a value to the
          <a class="link" href="security.html#sysvar_connection_control_failed_connections_threshold"><code class="literal">connection_control_failed_connections_threshold</code></a>
          system variable at runtime resets all accumulated
          failed-connection counters to zero, which causes the table to
          become empty.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="extended-show"></a>24.34 Extensions to SHOW Statements</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm140710588967488"></a><a class="indexterm" name="idm140710588966448"></a><a class="indexterm" name="idm140710588965376"></a><p>
      Some extensions to <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements
      accompany the implementation of
      <code class="literal">INFORMATION_SCHEMA</code>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> can be used to get
          information about the structure of
          <code class="literal">INFORMATION_SCHEMA</code> itself.
        </p></li><li class="listitem"><p>
          Several <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements accept
          a <code class="literal">WHERE</code> clause that provides more
          flexibility in specifying which rows to display.
</p></li></ul>
</div>
<p>
      <code class="literal">INFORMATION_SCHEMA</code> is an information database,
      so its name is included in the output from
      <a class="link" href="sql-syntax.html#show-databases" title="13.7.5.14 SHOW DATABASES Syntax"><code class="literal">SHOW DATABASES</code></a>. Similarly,
      <a class="link" href="sql-syntax.html#show-tables" title="13.7.5.37 SHOW TABLES Syntax"><code class="literal">SHOW TABLES</code></a> can be used with
      <code class="literal">INFORMATION_SCHEMA</code> to obtain a list of its
      tables:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SHOW TABLES FROM INFORMATION_SCHEMA;</code></strong>
+---------------------------------------+
| Tables_in_INFORMATION_SCHEMA          |
+---------------------------------------+
| CHARACTER_SETS                        |
| COLLATIONS                            |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS                               |
| COLUMN_PRIVILEGES                     |
| ENGINES                               |
| EVENTS                                |
| FILES                                 |
| GLOBAL_STATUS                         |
| GLOBAL_VARIABLES                      |
| KEY_COLUMN_USAGE                      |
| PARTITIONS                            |
| PLUGINS                               |
| PROCESSLIST                           |
| REFERENTIAL_CONSTRAINTS               |
| ROUTINES                              |
| SCHEMATA                              |
| SCHEMA_PRIVILEGES                     |
| SESSION_STATUS                        |
| SESSION_VARIABLES                     |
| STATISTICS                            |
| TABLES                                |
| TABLE_CONSTRAINTS                     |
| TABLE_PRIVILEGES                      |
| TRIGGERS                              |
| USER_PRIVILEGES                       |
| VIEWS                                 |
+---------------------------------------+
</pre><p>
      <a class="link" href="sql-syntax.html#show-columns" title="13.7.5.5 SHOW COLUMNS Syntax"><code class="literal">SHOW COLUMNS</code></a> and
      <a class="link" href="sql-syntax.html#describe" title="13.8.1 DESCRIBE Syntax"><code class="literal">DESCRIBE</code></a> can display information
      about the columns in individual
      <code class="literal">INFORMATION_SCHEMA</code> tables.
    </p><p>
      <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statements that accept a
      <a class="link" href="functions.html#operator_like"><code class="literal">LIKE</code></a> clause to limit the rows
      displayed also permit a <code class="literal">WHERE</code> clause that
      specifies more general conditions that selected rows must satisfy:
    </p><pre data-lang="sql" class="programlisting">
SHOW CHARACTER SET
SHOW COLLATION
SHOW COLUMNS
SHOW DATABASES
SHOW FUNCTION STATUS
SHOW INDEX
SHOW OPEN TABLES
SHOW PROCEDURE STATUS
SHOW STATUS
SHOW TABLE STATUS
SHOW TABLES
SHOW TRIGGERS
SHOW VARIABLES
</pre><p>
      The <code class="literal">WHERE</code> clause, if present, is evaluated
      against the column names displayed by the
      <a class="link" href="sql-syntax.html#show" title="13.7.5 SHOW Syntax"><code class="literal">SHOW</code></a> statement. For example, the
      <a class="link" href="sql-syntax.html#show-character-set" title="13.7.5.3 SHOW CHARACTER SET Syntax"><code class="literal">SHOW CHARACTER SET</code></a> statement
      produces these output columns:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SHOW CHARACTER SET;</code></strong>
+----------+-----------------------------+---------------------+--------+
| Charset  | Description                 | Default collation   | Maxlen |
+----------+-----------------------------+---------------------+--------+
| big5     | Big5 Traditional Chinese    | big5_chinese_ci     |      2 |
| dec8     | DEC West European           | dec8_swedish_ci     |      1 |
| cp850    | DOS West European           | cp850_general_ci    |      1 |
| hp8      | HP West European            | hp8_english_ci      |      1 |
| koi8r    | KOI8-R Relcom Russian       | koi8r_general_ci    |      1 |
| latin1   | cp1252 West European        | latin1_swedish_ci   |      1 |
| latin2   | ISO 8859-2 Central European | latin2_general_ci   |      1 |
...
</pre><p>
      To use a <code class="literal">WHERE</code> clause with
      <a class="link" href="sql-syntax.html#show-character-set" title="13.7.5.3 SHOW CHARACTER SET Syntax"><code class="literal">SHOW CHARACTER SET</code></a>, you would refer
      to those column names. As an example, the following statement
      displays information about character sets for which the default
      collation contains the string <code class="literal">'japanese'</code>:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SHOW CHARACTER SET WHERE `Default collation` LIKE '%japanese%';</code></strong>
+---------+---------------------------+---------------------+--------+
| Charset | Description               | Default collation   | Maxlen |
+---------+---------------------------+---------------------+--------+
| ujis    | EUC-JP Japanese           | ujis_japanese_ci    |      3 |
| sjis    | Shift-JIS Japanese        | sjis_japanese_ci    |      2 |
| cp932   | SJIS for Windows Japanese | cp932_japanese_ci   |      2 |
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci |      3 |
+---------+---------------------------+---------------------+--------+
</pre><p>
      This statement displays the multibyte character sets:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SHOW CHARACTER SET WHERE Maxlen &gt; 1;</code></strong>
+---------+---------------------------+---------------------+--------+
| Charset | Description               | Default collation   | Maxlen |
+---------+---------------------------+---------------------+--------+
| big5    | Big5 Traditional Chinese  | big5_chinese_ci     |      2 |
| ujis    | EUC-JP Japanese           | ujis_japanese_ci    |      3 |
| sjis    | Shift-JIS Japanese        | sjis_japanese_ci    |      2 |
| euckr   | EUC-KR Korean             | euckr_korean_ci     |      2 |
| gb2312  | GB2312 Simplified Chinese | gb2312_chinese_ci   |      2 |
| gbk     | GBK Simplified Chinese    | gbk_chinese_ci      |      2 |
| utf8    | UTF-8 Unicode             | utf8_general_ci     |      3 |
| ucs2    | UCS-2 Unicode             | ucs2_general_ci     |      2 |
| cp932   | SJIS for Windows Japanese | cp932_japanese_ci   |      2 |
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci |      3 |
+---------+---------------------------+---------------------+--------+
</pre>
</div>

</div>
<div class="copyright-footer">

</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="stored-programs-views.html">Prev</a></td>
<td width="20%" align="center"><a accesskey="u" href="">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="performance-schema.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 23 Stored Programs and Views</td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top">Chapter 25 MySQL Performance Schema</td>
</tr>
</table>
</div>
</body>
</html>
